** Adjust pending gotos to outer level of a block. */
| 608 | ** Adjust pending gotos to outer level of a block. |
| 609 | */ |
| 610 | static void movegotosout (FuncState *fs, BlockCnt *bl) { |
| 611 | int i; |
| 612 | Labellist *gl = &fs->ls->dyd->gt; |
| 613 | /* correct pending gotos to current block */ |
| 614 | for (i = bl->firstgoto; i < gl->n; i++) { /* for each pending goto */ |
| 615 | Labeldesc *gt = &gl->arr[i]; |
| 616 | /* leaving a variable scope? */ |
| 617 | if (stacklevel(fs, gt->nactvar) > stacklevel(fs, bl->nactvar)) |
| 618 | gt->close |= bl->upval; /* jump may need a close */ |
| 619 | gt->nactvar = bl->nactvar; /* update goto level */ |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | |
| 624 | static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) { |
no test coverage detected