Commits

Hakan Ardo  committed 5dda9e0

make sure guards for a box are emited before the box is used

  • Participants
  • Parent commits 2314a6c
  • Branches jit-short_from_state

Comments (0)

Files changed (1)

File pypy/jit/metainterp/optimizeopt/unroll.py

         
         for result, op in self.short_boxes.items():
             if op is not None:
-                for op in self.getvalue(result).make_guards(result):
+                if len(self.getvalue(result).make_guards(result)) > 0:
                     self.add_op_to_short(op, short, short_seen)
 
         self.optimizer.flush()
             guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
             self.add_op_to_short(guard, short, short_seen)
 
+        if op.result in self.short_boxes:
+            for guard in self.getvalue(op.result).make_guards(op.result):
+                self.add_op_to_short(guard, short, short_seen)
+
         return newop.result
         
     def import_box(self, box, inputargs, short, short_jumpargs,