aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-12-16 17:06:52 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-12-16 17:06:52 -0200
commita948054a1951cd526c732d6a0e16d99cae837d49 (patch)
treed13984803c85e83eda285a285bd3de2e05a603af /lcode.c
parenta8f8c7fd80a5c7e630fd4bf7f858d05024f6b434 (diff)
downloadlua-a948054a1951cd526c732d6a0e16d99cae837d49.tar.gz
lua-a948054a1951cd526c732d6a0e16d99cae837d49.tar.bz2
lua-a948054a1951cd526c732d6a0e16d99cae837d49.zip
new order for binary operations (grouping them by type of result)
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lcode.c b/lcode.c
index 34dadd1f..149114cf 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.72 2013/08/30 16:01:37 roberto Exp roberto $ 2** $Id: lcode.c,v 2.73 2013/12/16 14:30:22 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -762,6 +762,7 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
762 ((op == OP_MOD && ivalue(&v2) == 0) || /* ...avoid module by 0... */ 762 ((op == OP_MOD && ivalue(&v2) == 0) || /* ...avoid module by 0... */
763 (op == OP_POW && ivalue(&v2) < 0))) /* ...and negative exponents */ 763 (op == OP_POW && ivalue(&v2) < 0))) /* ...and negative exponents */
764 return 0; 764 return 0;
765 lua_assert(OP_IDIV - OP_ADD + LUA_OPADD == LUA_OPIDIV);
765 luaO_arith(NULL, op - OP_ADD + LUA_OPADD, &v1, &v2, &res); 766 luaO_arith(NULL, op - OP_ADD + LUA_OPADD, &v1, &v2, &res);
766 if (ttisinteger(&res)) { 767 if (ttisinteger(&res)) {
767 e1->k = VKINT; 768 e1->k = VKINT;