diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-07-20 13:49:29 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-07-20 15:36:25 -0700 |
commit | 3662f1410d68212ce9eedcb8d20cf4a5f035424e (patch) | |
tree | db434f94df3e9cf82fe76ab4bc40d52341e530a1 | |
parent | 2960d86291048b16cf49270b7649ccf971a73437 (diff) |
Also assert against dangling references after resolving typerefs and processing replacements
Because these operations mutate the IR graph, its better to be safe and double
check again. Don't worry -- these checks only happen on
`testing_only_extra_assertions` builds!
-rw-r--r-- | src/ir/context.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs index c11d7713..ec79577f 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -763,6 +763,10 @@ impl<'ctx> BindgenContext<'ctx> { self.process_replacements(); } + // And assert once again, because resolving type refs and processing + // replacements both mutate the IR graph. + self.assert_no_dangling_references(); + // Compute the whitelisted set after processing replacements and // resolving type refs, as those are the final mutations of the IR // graph, and their completion means that the IR graph is now frozen. |