CloneContext: Assert objects are owned by the program

Check that pre-clone objects are owned by the source program.
Check that post-clone object are owned by the target builder.

Fixed: tint:469
Change-Id: Idd0eeb8dfb386e295b66b4b6621cc13dc1a30786
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48260
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-04-19 16:50:23 +00:00
committed by Commit Bot service account
parent b895ba1cea
commit 917b14b626
6 changed files with 88 additions and 3 deletions

View File

@@ -1505,6 +1505,12 @@ struct ProgramBuilder::TypesBuilder::CToAST<void> {
};
//! @endcond
/// @param builder the ProgramBuilder
/// @returns the ProgramID of the ProgramBuilder
inline ProgramID ProgramIDOf(const ProgramBuilder* builder) {
return builder->ID();
}
} // namespace tint
#endif // SRC_PROGRAM_BUILDER_H_