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

Method RemoveCallerFrame

state.go:2289–2300  ·  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

2287// RemoveCallerFrame removes the stack frame above the current stack frame. This is useful in tail calls. It returns
2288// the new current frame.
2289func (ls *LState) RemoveCallerFrame() *callFrame {
2290 cs := ls.stack
2291 sp := cs.Sp()
2292 parentFrame := cs.At(sp - 2)
2293 currentFrame := cs.At(sp - 1)
2294 parentsParentFrame := parentFrame.Parent
2295 *parentFrame = *currentFrame
2296 parentFrame.Parent = parentsParentFrame
2297 parentFrame.Idx = sp - 2
2298 cs.Pop()
2299 return parentFrame
2300}
2301
2302/* }}} */
2303

Callers 2

callGFunctionFunction · 0.45
callGFunctionFunction · 0.45

Calls 3

SpMethod · 0.65
AtMethod · 0.65
PopMethod · 0.65

Tested by

no test coverage detected