summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-22 16:15:56 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-22 16:15:56 +0800
commit285a44058ed77624a808680ea435ca506d585de9 (patch)
tree84a93f6fe992f5a859384164b29953f85bacf92d
parentbce6d762ae4977d9b8ebfafa326a6e0c838e1914 (diff)
downloadmrust-285a44058ed77624a808680ea435ca506d585de9.tar.gz
MIR Optimise - Validate before GC
-rw-r--r--src/mir/optimise.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mir/optimise.cpp b/src/mir/optimise.cpp
index a0b42e0d..b67aa4d2 100644
--- a/src/mir/optimise.cpp
+++ b/src/mir/optimise.cpp
@@ -324,6 +324,8 @@ void MIR_Optimise(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path
MIR_Optimise_UnifyBlocks(state, fcn);
+ // DEFENCE: Run validation _before_ GC (so validation errors refer to the pre-gc numbers)
+ MIR_Validate(resolve, path, fcn, args, ret_type);
// GC pass on blocks and variables
// - Find unused blocks, then delete and rewrite all references.
MIR_Optimise_GarbageCollect(state, fcn);