Don't test bitwise operations on operands that don't fit in u32.
The current behavior is undefined in C when converting the double to a u32, so the tests fail on some compilers. For now, I'm just removing those parts of the tests because I'm not sure what I want the behavior to be. Modulo? Truncate? Runtime error?
This commit is contained in:
+1
-3
@@ -618,9 +618,7 @@ DEF_PRIMITIVE(num_bangeq)
|
||||
DEF_PRIMITIVE(num_bitwiseNot)
|
||||
{
|
||||
// Bitwise operators always work on 32-bit unsigned ints.
|
||||
uint64_t wideVal = AS_NUM(args[0]);
|
||||
uint32_t val = wideVal & 0xFFFFFFFF;
|
||||
RETURN_NUM(~(uint32_t)val);
|
||||
RETURN_NUM(~(uint32_t)AS_NUM(args[0]));
|
||||
}
|
||||
|
||||
DEF_PRIMITIVE(num_dotDot)
|
||||
|
||||
Reference in New Issue
Block a user