Opcodes which consume no inputs should indicate they produced the value, not an arbitrary local
self.assertInBytecode(f, "LOAD_FAST_BORROW")
self.assertNotInBytecode(f, "LOAD_FAST_CHECK")
+ def test_import_from_doesnt_clobber_load_fast_borrow(self):
+ def f(self):
+ if x: pass
+ self.x
+ from shutil import ExecError
+ print(ExecError)
+ self.assertInBytecode(f, "LOAD_FAST_BORROW", "self")
class DirectCfgOptimizerTests(CfgOptimizationTestCase):
int num_pushed = _PyOpcode_num_pushed(opcode, oparg);
int net_pushed = num_pushed - num_popped;
assert(net_pushed >= 0);
- for (int i = 0; i < net_pushed; i++) {
+ for (int j = 0; j < net_pushed; j++) {
PUSH_REF(i, NOT_LOCAL);
}
break;