]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix line number for relocated bytecode after closure fixup.
authorMike Pall <mike>
Tue, 15 Oct 2013 20:46:39 +0000 (22:46 +0200)
committerMike Pall <mike>
Tue, 15 Oct 2013 20:46:39 +0000 (22:46 +0200)
src/lj_parse.c

index 7ff7d72855d7b8d62f01a80ff7a8f1b479969ca1..882399c704264d5340916e14057166d492caaccd 100644 (file)
@@ -1555,7 +1555,9 @@ static void fs_fixup_ret(FuncState *fs)
       switch (bc_op(ins)) {
       case BC_CALLMT: case BC_CALLT:
       case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1:
-       offset = bcemit_INS(fs, ins)-(pc+1)+BCBIAS_J;  /* Copy return ins. */
+       offset = bcemit_INS(fs, ins);  /* Copy original instruction. */
+       fs->bcbase[offset].line = fs->bcbase[pc].line;
+       offset = offset-(pc+1)+BCBIAS_J;
        if (offset > BCMAX_D)
          err_syntax(fs->ls, LJ_ERR_XFIXUP);
        /* Replace with UCLO plus branch. */