@@ -379,7 +379,7 @@ func do_IMPORT_STAR(vm *Vm, arg int32) {
379
379
// Removes one block from the block stack. Per frame, there is a stack
380
380
// of blocks, denoting nested loops, try statements, and such.
381
381
func do_POP_BLOCK (vm * Vm , arg int32 ) {
382
- vm .NotImplemented ( "POP_BLOCK" , arg )
382
+ vm .frame . PopBlock ( )
383
383
}
384
384
385
385
// Removes one block from the block stack. The popped block must be an
@@ -620,19 +620,19 @@ func do_LOAD_GLOBAL(vm *Vm, namei int32) {
620
620
// Pushes a block for a loop onto the block stack. The block spans
621
621
// from the current instruction with a size of delta bytes.
622
622
func do_SETUP_LOOP (vm * Vm , delta int32 ) {
623
- vm .NotImplemented ( " SETUP_LOOP" , delta )
623
+ vm .frame . PushBlock ( SETUP_LOOP , vm . frame . Lasti + delta , len ( vm . stack ) )
624
624
}
625
625
626
626
// Pushes a try block from a try-except clause onto the block
627
627
// stack. delta points to the first except block.
628
628
func do_SETUP_EXCEPT (vm * Vm , delta int32 ) {
629
- vm .NotImplemented ( " SETUP_EXCEPT" , delta )
629
+ vm .frame . PushBlock ( SETUP_EXCEPT , vm . frame . Lasti + delta , len ( vm . stack ) )
630
630
}
631
631
632
632
// Pushes a try block from a try-except clause onto the block
633
633
// stack. delta points to the finally block.
634
634
func do_SETUP_FINALLY (vm * Vm , delta int32 ) {
635
- vm .NotImplemented ( " SETUP_FINALLY" , delta )
635
+ vm .frame . PushBlock ( SETUP_FINALLY , vm . frame . Lasti + delta , len ( vm . stack ) )
636
636
}
637
637
638
638
// Store a key and value pair in a dictionary. Pops the key and value
@@ -931,7 +931,7 @@ func Run(globals, locals py.StringDict, code *py.Code) (err error) {
931
931
if HAS_ARG (opcode ) {
932
932
arg = int32 (opcodes [frame .Lasti ])
933
933
frame .Lasti ++
934
- arg += int32 (opcodes [frame .Lasti ] << 8 )
934
+ arg += int32 (opcodes [frame .Lasti ]) << 8
935
935
frame .Lasti ++
936
936
if vm .extended {
937
937
arg += vm .ext << 16
0 commit comments