We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
State.stackIndex
1 parent aa16730 commit e7d59e9Copy full SHA for e7d59e9
internal/mylua/lua.go
@@ -130,7 +130,7 @@ func (l *State) stackIndex(idx int) (int, error) {
130
if idx < -l.Top() {
131
return -1, fmt.Errorf("invalid index %d (top = %d)", idx, l.Top())
132
}
133
- return l.frame().registerStart() - idx - 1, nil
+ return len(l.stack) + idx, nil
134
135
i := l.frame().registerStart() + idx - 1
136
if i >= cap(l.stack) {
0 commit comments