diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-01-31 12:52:32 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-01-31 12:52:32 -0200 |
commit | a7faa557fab4134966b1bdc0e1169a24c0f8cab3 (patch) | |
tree | f32e1f83a5f9f853e5cdc857db142f76ab40efcf | |
parent | 026a7e92bec8f313d8286a64f8bfc3d2b199e18e (diff) | |
download | lua-a7faa557fab4134966b1bdc0e1169a24c0f8cab3.tar.gz lua-a7faa557fab4134966b1bdc0e1169a24c0f8cab3.tar.bz2 lua-a7faa557fab4134966b1bdc0e1169a24c0f8cab3.zip |
bug: problem with optimizations of short-circuit logic
-rw-r--r-- | bugs | 47 |
1 files changed, 45 insertions, 2 deletions
@@ -1880,8 +1880,8 @@ patch = [[ | |||
1880 | +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 | 1880 | +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 |
1881 | @@ -1,5 +1,5 @@ | 1881 | @@ -1,5 +1,5 @@ |
1882 | /* | 1882 | /* |
1883 | -** $Id: bugs,v 1.107 2010/04/19 18:04:58 roberto Exp roberto $ | 1883 | -** $Id: bugs,v 1.108 2010/05/14 15:34:57 roberto Exp roberto $ |
1884 | +** $Id: bugs,v 1.107 2010/04/19 18:04:58 roberto Exp roberto $ | 1884 | +** $Id: bugs,v 1.108 2010/05/14 15:34:57 roberto Exp roberto $ |
1885 | ** load precompiled Lua chunks | 1885 | ** load precompiled Lua chunks |
1886 | ** See Copyright Notice in lua.h | 1886 | ** See Copyright Notice in lua.h |
1887 | */ | 1887 | */ |
@@ -2316,3 +2316,46 @@ patch = [[ | |||
2316 | ]] | 2316 | ]] |
2317 | } | 2317 | } |
2318 | 2318 | ||
2319 | Bug{ | ||
2320 | what = [[wrong code generation for some particular boolean expressions]], | ||
2321 | report = [[Thierry Van Elsuwe, 2011/01/20]], | ||
2322 | since = [[5.0]], | ||
2323 | example = [[ | ||
2324 | print((('hi' or true) and true) or true) | ||
2325 | --> hi (should be true) | ||
2326 | print(((nil and nil) or false) and true) | ||
2327 | --> nil (should be false) | ||
2328 | ]], | ||
2329 | patch = [[ | ||
2330 | --- lcode.c 2009/06/15 14:12:25 2.25.1.4 | ||
2331 | +++ lcode.c 2011/01/31 14:44:25 | ||
2332 | @@ -549,13 +549,6 @@ | ||
2333 | pc = e->u.s.info; | ||
2334 | break; | ||
2335 | } | ||
2336 | - case VFALSE: { | ||
2337 | - if (!hasjumps(e)) { | ||
2338 | - pc = luaK_jump(fs); /* always jump */ | ||
2339 | - break; | ||
2340 | - } | ||
2341 | - /* else go through */ | ||
2342 | - } | ||
2343 | default: { | ||
2344 | pc = jumponcond(fs, e, 0); | ||
2345 | break; | ||
2346 | @@ -579,13 +572,6 @@ | ||
2347 | pc = e->u.s.info; | ||
2348 | break; | ||
2349 | } | ||
2350 | - case VTRUE: { | ||
2351 | - if (!hasjumps(e)) { | ||
2352 | - pc = luaK_jump(fs); /* always jump */ | ||
2353 | - break; | ||
2354 | - } | ||
2355 | - /* else go through */ | ||
2356 | - } | ||
2357 | default: { | ||
2358 | pc = jumponcond(fs, e, 1); | ||
2359 | break; | ||
2360 | ]] | ||
2361 | } | ||