diff options
Diffstat (limited to 'src/lua/lcode.c')
-rw-r--r-- | src/lua/lcode.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/lua/lcode.c b/src/lua/lcode.c index d8d353f..80d975c 100644 --- a/src/lua/lcode.c +++ b/src/lua/lcode.c | |||
@@ -314,15 +314,6 @@ void luaK_patchtohere (FuncState *fs, int list) { | |||
314 | } | 314 | } |
315 | 315 | ||
316 | 316 | ||
317 | /* | ||
318 | ** MAXimum number of successive Instructions WiTHout ABSolute line | ||
319 | ** information. | ||
320 | */ | ||
321 | #if !defined(MAXIWTHABS) | ||
322 | #define MAXIWTHABS 120 | ||
323 | #endif | ||
324 | |||
325 | |||
326 | /* limit for difference between lines in relative line info. */ | 317 | /* limit for difference between lines in relative line info. */ |
327 | #define LIMLINEDIFF 0x80 | 318 | #define LIMLINEDIFF 0x80 |
328 | 319 | ||
@@ -337,13 +328,13 @@ void luaK_patchtohere (FuncState *fs, int list) { | |||
337 | static void savelineinfo (FuncState *fs, Proto *f, int line) { | 328 | static void savelineinfo (FuncState *fs, Proto *f, int line) { |
338 | int linedif = line - fs->previousline; | 329 | int linedif = line - fs->previousline; |
339 | int pc = fs->pc - 1; /* last instruction coded */ | 330 | int pc = fs->pc - 1; /* last instruction coded */ |
340 | if (abs(linedif) >= LIMLINEDIFF || fs->iwthabs++ > MAXIWTHABS) { | 331 | if (abs(linedif) >= LIMLINEDIFF || fs->iwthabs++ >= MAXIWTHABS) { |
341 | luaM_growvector(fs->ls->L, f->abslineinfo, fs->nabslineinfo, | 332 | luaM_growvector(fs->ls->L, f->abslineinfo, fs->nabslineinfo, |
342 | f->sizeabslineinfo, AbsLineInfo, MAX_INT, "lines"); | 333 | f->sizeabslineinfo, AbsLineInfo, MAX_INT, "lines"); |
343 | f->abslineinfo[fs->nabslineinfo].pc = pc; | 334 | f->abslineinfo[fs->nabslineinfo].pc = pc; |
344 | f->abslineinfo[fs->nabslineinfo++].line = line; | 335 | f->abslineinfo[fs->nabslineinfo++].line = line; |
345 | linedif = ABSLINEINFO; /* signal that there is absolute information */ | 336 | linedif = ABSLINEINFO; /* signal that there is absolute information */ |
346 | fs->iwthabs = 0; /* restart counter */ | 337 | fs->iwthabs = 1; /* restart counter */ |
347 | } | 338 | } |
348 | luaM_growvector(fs->ls->L, f->lineinfo, pc, f->sizelineinfo, ls_byte, | 339 | luaM_growvector(fs->ls->L, f->lineinfo, pc, f->sizelineinfo, ls_byte, |
349 | MAX_INT, "opcodes"); | 340 | MAX_INT, "opcodes"); |
@@ -1307,7 +1298,8 @@ static int validop (int op, TValue *v1, TValue *v2) { | |||
1307 | case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: | 1298 | case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: |
1308 | case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ | 1299 | case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ |
1309 | lua_Integer i; | 1300 | lua_Integer i; |
1310 | return (tointegerns(v1, &i) && tointegerns(v2, &i)); | 1301 | return (luaV_tointegerns(v1, &i, LUA_FLOORN2I) && |
1302 | luaV_tointegerns(v2, &i, LUA_FLOORN2I)); | ||
1311 | } | 1303 | } |
1312 | case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ | 1304 | case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ |
1313 | return (nvalue(v2) != 0); | 1305 | return (nvalue(v2) != 0); |