diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-02-11 11:12:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-02-11 11:12:33 -0300 |
| commit | 9b7987a9d1471ba94764286b28e0998f73deb46a (patch) | |
| tree | b24e2836a29621521d65e6dc77fb39bdc4b627ee /lcode.c | |
| parent | 28ef7061bbcce39590c97a2ad662e0b60f7adab5 (diff) | |
| download | lua-9b7987a9d1471ba94764286b28e0998f73deb46a.tar.gz lua-9b7987a9d1471ba94764286b28e0998f73deb46a.tar.bz2 lua-9b7987a9d1471ba94764286b28e0998f73deb46a.zip | |
OP_LOADFALSE broken in two instructions
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -872,9 +872,9 @@ static void discharge2anyreg (FuncState *fs, expdesc *e) { | |||
| 872 | } | 872 | } |
| 873 | 873 | ||
| 874 | 874 | ||
| 875 | static int code_loadbool (FuncState *fs, int A, OpCode op, int jump) { | 875 | static int code_loadbool (FuncState *fs, int A, OpCode op) { |
| 876 | luaK_getlabel(fs); /* those instructions may be jump targets */ | 876 | luaK_getlabel(fs); /* those instructions may be jump targets */ |
| 877 | return luaK_codeABC(fs, op, A, jump, 0); | 877 | return luaK_codeABC(fs, op, A, 0, 0); |
| 878 | } | 878 | } |
| 879 | 879 | ||
| 880 | 880 | ||
| @@ -908,8 +908,8 @@ static void exp2reg (FuncState *fs, expdesc *e, int reg) { | |||
| 908 | int p_t = NO_JUMP; /* position of an eventual LOAD true */ | 908 | int p_t = NO_JUMP; /* position of an eventual LOAD true */ |
| 909 | if (need_value(fs, e->t) || need_value(fs, e->f)) { | 909 | if (need_value(fs, e->t) || need_value(fs, e->f)) { |
| 910 | int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); | 910 | int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); |
| 911 | p_f = code_loadbool(fs, reg, OP_LOADFALSE, 1); /* skip next inst. */ | 911 | p_f = code_loadbool(fs, reg, OP_LFALSESKIP); /* skip next inst. */ |
| 912 | p_t = code_loadbool(fs, reg, OP_LOADTRUE, 0); | 912 | p_t = code_loadbool(fs, reg, OP_LOADTRUE); |
| 913 | /* jump around these booleans if 'e' is not a test */ | 913 | /* jump around these booleans if 'e' is not a test */ |
| 914 | luaK_patchtohere(fs, fj); | 914 | luaK_patchtohere(fs, fj); |
| 915 | } | 915 | } |
