|
@@ -6,14 +6,16 @@ package lua
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
- "github.com/yuin/gopher-lua/parse"
|
|
|
"io"
|
|
|
+ "log"
|
|
|
"math"
|
|
|
"os"
|
|
|
"runtime"
|
|
|
"strings"
|
|
|
"sync/atomic"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/yuin/gopher-lua/parse"
|
|
|
)
|
|
|
|
|
|
const MultRet = -1
|
|
@@ -1147,8 +1149,9 @@ func (ls *LState) Pop(n int) {
|
|
|
for i := 0; i < n; i++ {
|
|
|
if ls.GetTop() == 0 {
|
|
|
ls.RaiseError("register underflow")
|
|
|
+ } else {
|
|
|
+ ls.reg.Pop()
|
|
|
}
|
|
|
- ls.reg.Pop()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1302,7 +1305,8 @@ func (ls *LState) ToThread(n int) *LState {
|
|
|
|
|
|
// This function is equivalent to luaL_error( http://www.lua.org/manual/5.1/manual.html#luaL_error ).
|
|
|
func (ls *LState) RaiseError(format string, args ...interface{}) {
|
|
|
- ls.raiseError(1, format, args...)
|
|
|
+ log.Println("Pop 出错,脚本名称", ls.ScriptFileName)
|
|
|
+ //ls.raiseError(1, format, args...)
|
|
|
}
|
|
|
|
|
|
// This function is equivalent to lua_error( http://www.lua.org/manual/5.1/manual.html#lua_error ).
|