MCPcopy Index your code
hub / github.com/yuin/gopher-lua / RemoveCallerFrame

Method RemoveCallerFrame

_state.go:2076–2087  ·  view source on GitHub ↗

RemoveCallerFrame removes the stack frame above the current stack frame. This is useful in tail calls. It returns the new current frame.

()

Source from the content-addressed store, hash-verified

2074// RemoveCallerFrame removes the stack frame above the current stack frame. This is useful in tail calls. It returns
2075// the new current frame.
2076func (ls *LState) RemoveCallerFrame() *callFrame {
2077 cs := ls.stack
2078 sp := cs.Sp()
2079 parentFrame := cs.At(sp - 2)
2080 currentFrame := cs.At(sp - 1)
2081 parentsParentFrame := parentFrame.Parent
2082 *parentFrame = *currentFrame
2083 parentFrame.Parent = parentsParentFrame
2084 parentFrame.Idx = sp - 2
2085 cs.Pop()
2086 return parentFrame
2087}
2088
2089/* }}} */
2090

Callers

nothing calls this directly

Calls 3

SpMethod · 0.65
AtMethod · 0.65
PopMethod · 0.65

Tested by

no test coverage detected