remove callable args alloc (#259)

This commit is contained in:
Ozan Hacıbekiroğlu 2020-03-15 18:45:40 +02:00 committed by GitHub
parent b555842004
commit b75bda7da7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
vm.go
View file

@ -604,9 +604,7 @@ func (v *VM) run() {
v.framesIndex++
v.sp = v.sp - numArgs + callee.NumLocals
} else {
var args []Object
args = append(args, v.stack[v.sp-numArgs:v.sp]...)
ret, e := value.Call(args...)
ret, e := value.Call(v.stack[v.sp-numArgs : v.sp]...)
v.sp -= numArgs + 1
// runtime error