aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-22 13:37:17 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-22 13:37:17 -0300
commit23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff (patch)
treeb8f01be3b195252ecb414092dce98299fc325a54 /lopcodes.c
parent682054920ddc434fd4a7f8cc78027dbb03f47f00 (diff)
downloadlua-23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff.tar.gz
lua-23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff.tar.bz2
lua-23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff.zip
Keep correct type for immediate operands in comparisons
When calling metamethods for things like 'a < 3.0', which generates the opcode OP_LTI, the C register tells that the operand was converted to an integer, so that it can be corrected to float when calling a metamethod. This commit also includes some other stuff: - file 'onelua.c' added to the project - opcode OP_PREPVARARG renamed to OP_VARARGPREP - comparison opcodes rewritten through macros
Diffstat (limited to 'lopcodes.c')
-rw-r--r--lopcodes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lopcodes.c b/lopcodes.c
index c35a0aaf..23c3a6e4 100644
--- a/lopcodes.c
+++ b/lopcodes.c
@@ -101,7 +101,7 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
101 ,opmode(0, 1, 0, 0, iABC) /* OP_SETLIST */ 101 ,opmode(0, 1, 0, 0, iABC) /* OP_SETLIST */
102 ,opmode(0, 0, 0, 1, iABx) /* OP_CLOSURE */ 102 ,opmode(0, 0, 0, 1, iABx) /* OP_CLOSURE */
103 ,opmode(1, 0, 0, 1, iABC) /* OP_VARARG */ 103 ,opmode(1, 0, 0, 1, iABC) /* OP_VARARG */
104 ,opmode(0, 0, 0, 1, iABC) /* OP_PREPVARARG */ 104 ,opmode(0, 0, 0, 1, iABC) /* OP_VARARGPREP */
105 ,opmode(0, 0, 0, 0, iAx) /* OP_EXTRAARG */ 105 ,opmode(0, 0, 0, 0, iAx) /* OP_EXTRAARG */
106}; 106};
107 107