10000 Remove unneeded nil check in STORE_LOCALS now __build_class__ is fixed · go-python/gpython@6fd60a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fd60a4

Browse files
committed
Remove unneeded nil check in STORE_LOCALS now __build_class__ is fixed
1 parent 984bfd8 commit 6fd60a4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

vm/eval.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ func do_GET_ITER(vm *Vm, arg int32) {
115115
// f_locals. This is used in class construction.
116116
func do_STORE_LOCALS(vm *Vm, arg int32) {
117117
locals := vm.POP()
118-
// FIXME don't know why it is getting nil here?
119-
if locals == nil {
120-
locals = py.StringDict{}
121-
}
122118
vm.frame.Locals = locals.(py.StringDict)
123119
}
124120

@@ -702,6 +698,7 @@ func do_STORE_MAP(vm *Vm, arg int32) {
702698

703699
// Pushes a reference to the local co_varnames[var_num] onto the stack.
704700
func do_LOAD_FAST(vm *Vm, var_num int32) {
701+
fmt.Printf("LOAD_FAST %q\n", vm.frame.Code.Varnames[var_num])
705702
vm.PUSH(vm.frame.Locals[vm.frame.Code.Varnames[var_num]])
706703
}
707704

@@ -889,7 +886,7 @@ func do_CALL_FUNCTION_VAR_KW(vm *Vm, argc int32) {
889886
func (vm *Vm) NotImplemented(name string, arg int32) {
890887
fmt.Printf("%s %d NOT IMPLEMENTED\n", name, arg)
891888
fmt.Printf("vmstack = %#v\n", vm.stack)
892-
panic("Opcode not implemented")
889+
panic(fmt.Sprintf("Opcode %s %d NOT IMPLEMENTED", name, arg))
893890
}
894891

895892
// Calls function fn with args and kwargs

0 commit comments

Comments
 (0)
0