diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-22 13:37:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-22 13:37:17 -0300 |
commit | 23e6bac8a0bbb9e5df43cbc0b7634b6d1395b0ff (patch) | |
tree | b8f01be3b195252ecb414092dce98299fc325a54 /llimits.h | |
parent | 682054920ddc434fd4a7f8cc78027dbb03f47f00 (diff) | |
download | lua-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 'llimits.h')
-rw-r--r-- | llimits.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -325,6 +325,8 @@ typedef l_uint32 Instruction; | |||
325 | #define luai_numeq(a,b) ((a)==(b)) | 325 | #define luai_numeq(a,b) ((a)==(b)) |
326 | #define luai_numlt(a,b) ((a)<(b)) | 326 | #define luai_numlt(a,b) ((a)<(b)) |
327 | #define luai_numle(a,b) ((a)<=(b)) | 327 | #define luai_numle(a,b) ((a)<=(b)) |
328 | #define luai_numgt(a,b) ((a)>(b)) | ||
329 | #define luai_numge(a,b) ((a)>=(b)) | ||
328 | #define luai_numisnan(a) (!luai_numeq((a), (a))) | 330 | #define luai_numisnan(a) (!luai_numeq((a), (a))) |
329 | #endif | 331 | #endif |
330 | 332 | ||