Skip to content

Commit

Permalink
remove Lua return values from stack after calling a converted Lua fro…
Browse files Browse the repository at this point in the history
…m Go
  • Loading branch information
Tim Cooper committed Jul 4, 2016
1 parent 153f7ac commit 2093c26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,10 @@ func Example__35() {

fmt.Println(e.Fn2("hello", 1, 2))
fmt.Println(e.Fn2("hello", 1, 2, 3))

if L.GetTop() != 0 {
panic("expecting GetTop to return 0, got " + strconv.Itoa(L.GetTop()))
}
// Output:
// >A< 1
// >B< 2
Expand Down
1 change: 1 addition & 0 deletions luar.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func lValueToReflect(L *lua.LState, v lua.LValue, hint reflect.Type) reflect.Val
}

L.Call(len(args)+varadicCount, hint.NumOut())
defer L.Pop(hint.NumOut())

ret := make([]reflect.Value, hint.NumOut())

Expand Down

0 comments on commit 2093c26

Please sign in to comment.