Index: runtime/vm/redundancy_elimination.cc |
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc |
index 66a287cc15db1536fa15ee8595f93d5c31753d1d..1cabf787c2e9ed2396cf6c04c17a51b6364d1c99 100644 |
--- a/runtime/vm/redundancy_elimination.cc |
+++ b/runtime/vm/redundancy_elimination.cc |
@@ -2402,6 +2402,9 @@ bool DominatorBasedCSE::OptimizeRecursive(FlowGraph* graph, |
// Process children in the dominator tree recursively. |
intptr_t num_children = block->dominated_blocks().length(); |
+ if (num_children != 0) { |
+ graph->thread()->CheckForSafepoint(); |
+ } |
for (intptr_t i = 0; i < num_children; ++i) { |
BlockEntryInstr* child = block->dominated_blocks()[i]; |
if (i < num_children - 1) { |