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 --- llimits.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index 9d35d1c7..155bb160 100644 --- a/llimits.h +++ b/llimits.h @@ -325,6 +325,8 @@ typedef l_uint32 Instruction; #define luai_numeq(a,b) ((a)==(b)) #define luai_numlt(a,b) ((a)<(b)) #define luai_numle(a,b) ((a)<=(b)) +#define luai_numgt(a,b) ((a)>(b)) +#define luai_numge(a,b) ((a)>=(b)) #define luai_numisnan(a) (!luai_numeq((a), (a))) #endif -- cgit v1.2.3-55-g6feb