From 23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 22 Mar 2019 13:37:17 -0300 Subject: 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 --- lopcodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lopcodes.c') 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] = { ,opmode(0, 1, 0, 0, iABC) /* OP_SETLIST */ ,opmode(0, 0, 0, 1, iABx) /* OP_CLOSURE */ ,opmode(1, 0, 0, 1, iABC) /* OP_VARARG */ - ,opmode(0, 0, 0, 1, iABC) /* OP_PREPVARARG */ + ,opmode(0, 0, 0, 1, iABC) /* OP_VARARGPREP */ ,opmode(0, 0, 0, 0, iAx) /* OP_EXTRAARG */ }; -- cgit v1.2.3-55-g6feb