diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-06-29 12:06:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-06-29 12:06:44 -0300 |
commit | f96497397addca22f22a6ba6eeabc906be43f16b (patch) | |
tree | af8d27b9af36dfe0b0b6e0f765ea90b95b110efc /lcode.c | |
parent | 5a1c8d8ef343bf0157851a4832c2c937b812b64f (diff) | |
download | lua-f96497397addca22f22a6ba6eeabc906be43f16b.tar.gz lua-f96497397addca22f22a6ba6eeabc906be43f16b.tar.bz2 lua-f96497397addca22f22a6ba6eeabc906be43f16b.zip |
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.119 2017/05/18 19:44:19 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.120 2017/06/27 11:35:31 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 | */ |
@@ -1079,7 +1079,7 @@ static int constfolding (FuncState *fs, int op, expdesc *e1, | |||
1079 | TValue v1, v2, res; | 1079 | TValue v1, v2, res; |
1080 | if (!tonumeral(e1, &v1) || !tonumeral(e2, &v2) || !validop(op, &v1, &v2)) | 1080 | if (!tonumeral(e1, &v1) || !tonumeral(e2, &v2) || !validop(op, &v1, &v2)) |
1081 | return 0; /* non-numeric operands or not safe to fold */ | 1081 | return 0; /* non-numeric operands or not safe to fold */ |
1082 | luaO_arith(fs->ls->L, op, &v1, &v2, &res); /* does operation */ | 1082 | luaO_rawarith(fs->ls->L, op, &v1, &v2, &res); /* does operation */ |
1083 | if (ttisinteger(&res)) { | 1083 | if (ttisinteger(&res)) { |
1084 | e1->k = VKINT; | 1084 | e1->k = VKINT; |
1085 | e1->u.ival = ivalue(&res); | 1085 | e1->u.ival = ivalue(&res); |