MCPcopy Index your code
hub / github.com/Shopify/go-lua / LeaveBlock

Method LeaveBlock

code.go:232–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230}
231
232func (f *function) LeaveBlock() {
233 b := f.block
234 if b.previous != nil && b.hasUpValue { // create a 'jump to here' to close upvalues
235 j := f.Jump()
236 f.PatchClose(j, b.activeVariableCount)
237 f.PatchToHere(j)
238 }
239 if b.isLoop {
240 f.breakLabel() // close pending breaks
241 }
242 f.block = b.previous
243 f.removeLocalVariables(b.activeVariableCount)
244 f.assert(b.activeVariableCount == f.activeVariableCount)
245 f.freeRegisterCount = f.activeVariableCount
246 f.p.activeLabels = f.p.activeLabels[:b.firstLabel]
247 if b.previous != nil { // inner block
248 f.moveGotosOut(*b) // update pending gotos to outer block
249 } else if b.firstGoto < len(f.p.pendingGotos) { // pending gotos in outer block
250 f.undefinedGotoError(f.p.pendingGotos[b.firstGoto])
251 }
252}
253
254func abs(i int) int {
255 if i < 0 {

Callers 8

CloseFunctionMethod · 0.95
CloseForBodyMethod · 0.95
CloseMainFunctionMethod · 0.95
forStatementMethod · 0.80
testThenBlockMethod · 0.80
blockMethod · 0.80
whileStatementMethod · 0.80
repeatStatementMethod · 0.80

Calls 8

JumpMethod · 0.95
PatchCloseMethod · 0.95
PatchToHereMethod · 0.95
breakLabelMethod · 0.95
removeLocalVariablesMethod · 0.95
assertMethod · 0.95
moveGotosOutMethod · 0.95
undefinedGotoErrorMethod · 0.95

Tested by

no test coverage detected