()
| 230 | } |
| 231 | |
| 232 | func (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 | |
| 254 | func abs(i int) int { |
| 255 | if i < 0 { |
no test coverage detected