8000 Fix LOAD_NAME and remove incorrect workaround · go-python/gpython@bc5ac4a · GitHub
[go: up one dir, main page]

Skip to content

Commit bc5ac4a

Browse files
committed
Fix LOAD_NAME and remove incorrect workaround
1 parent 03f02c0 commit bc5ac4a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

vm/eval.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ func do_LOAD_CONST(vm *Vm, consti int32) {
557557

558558
// Pushes the value associated with co_names[namei] onto the stack.
559559
func do_LOAD_NAME(vm *Vm, namei int32) {
560-
vm.PUSH(py.String(vm.frame.Code.Names[namei]))
560+
fmt.Printf("LOAD_NAME %v\n", vm.frame.Code.Names[namei])
561+
vm.PUSH(vm.frame.Lookup(vm.frame.Code.Names[namei]))
561562
}
562563

563564
// Creates a tuple consuming count items from the stack, and pushes
@@ -952,11 +953,6 @@ func (vm *Vm) Call(fnObj py.Object, args []py.Object, kwargsTuple []py.Object) {
952953
}
953954
}
954955

955-
// Lookup if string
956-
if fn, ok := fnObj.(py.String); ok {
957-
fnObj = vm.frame.Lookup(string(fn))
958-
}
959-
960956
// Call the function pushing the return on the stack
961957
vm.PUSH(py.Call(fnObj, args, kwargs))
962958
}

0 commit comments

Comments
 (0)
0