summaryrefslogtreecommitdiff
path: root/bugs
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-06-15 11:12:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-06-15 11:12:59 -0300
commit49b88b1c39fca21f1f55e462e0f549b8187f89d6 (patch)
treebd81ea8bdcc7732438dd51f87fab359a0cca78f8 /bugs
parent3db5f60547d6f31892071f5c00032dfb79a8f729 (diff)
downloadlua-49b88b1c39fca21f1f55e462e0f549b8187f89d6.tar.gz
lua-49b88b1c39fca21f1f55e462e0f549b8187f89d6.tar.bz2
lua-49b88b1c39fca21f1f55e462e0f549b8187f89d6.zip
patch for wrong code generation for some particular boolean expressions
Diffstat (limited to 'bugs')
-rw-r--r--bugs51
1 files changed, 49 insertions, 2 deletions
diff --git a/bugs b/bugs
index 41c5f83e..a85e40cb 100644
--- a/bugs
+++ b/bugs
@@ -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.98 2008/08/06 13:32:45 roberto Exp roberto $ 1883-** $Id: bugs,v 1.99 2009/04/27 20:11:11 roberto Exp roberto $
1884+** $Id: bugs,v 1.98 2008/08/06 13:32:45 roberto Exp roberto $ 1884+** $Id: bugs,v 1.99 2009/04/27 20:11:11 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 */
@@ -2102,6 +2102,53 @@ print(((1 or false) and true) or false) --> 1
2102-- should be 'true' 2102-- should be 'true'
2103]], 2103]],
2104patch = [[ 2104patch = [[
2105--- lcode.c 2007/12/28 15:32:23 2.25.1.3
2106+++ lcode.c 2009/06/15 14:07:34
2107@@ -544,15 +544,18 @@
2108 pc = NO_JUMP; /* always true; do nothing */
2109 break;
2110 }
2111- case VFALSE: {
2112- pc = luaK_jump(fs); /* always jump */
2113- break;
2114- }
2115 case VJMP: {
2116 invertjump(fs, e);
2117 pc = e->u.s.info;
2118 break;
2119 }
2120+ case VFALSE: {
2121+ if (!hasjumps(e)) {
2122+ pc = luaK_jump(fs); /* always jump */
2123+ break;
2124+ }
2125+ /* else go through */
2126+ }
2127 default: {
2128 pc = jumponcond(fs, e, 0);
2129 break;
2130@@ -572,14 +575,17 @@
2131 pc = NO_JUMP; /* always false; do nothing */
2132 break;
2133 }
2134- case VTRUE: {
2135- pc = luaK_jump(fs); /* always jump */
2136- break;
2137- }
2138 case VJMP: {
2139 pc = e->u.s.info;
2140 break;
2141 }
2142+ case VTRUE: {
2143+ if (!hasjumps(e)) {
2144+ pc = luaK_jump(fs); /* always jump */
2145+ break;
2146+ }
2147+ /* else go through */
2148+ }
2149 default: {
2150 pc = jumponcond(fs, e, 1);
2151 break;
2105]], 2152]],
2106} 2153}
2107 2154