From fc3db1dfe3ebe3654228c45ed1054f80dcad30b6 Mon Sep 17 00:00:00 2001 From: Alexander Klauer Date: Wed, 1 Feb 2023 22:23:44 +0100 Subject: [PATCH] Bugfix: proper tail call rt.Call already runs the continuation, see https://github.com/arnodel/golua/issues/97 --- lua.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua.go b/lua.go index 781c35b..60a65f7 100644 --- a/lua.go +++ b/lua.go @@ -80,6 +80,5 @@ func tailMethodCall( if err != nil { return nil, err } - err = rt.Call(t, m, append([]rt.Value{obj}, args...), c.Next()) - return c.Next(), err + return nil, rt.Call(t, m, append([]rt.Value{obj}, args...), c.Next()) }