mirror of
https://github.com/janet-lang/janet
synced 2025-10-31 23:53:02 +00:00
Fix some issues found with -fsanitize=undefined
Leave in issues with calling memcpy with size=0. If these become a problem, will probably add a janet_memcpy as memcpy is used so much in the code without 0 checks.
This commit is contained in:
@@ -89,8 +89,9 @@ static void janetc_loadconst(JanetCompiler *c, Janet k, int32_t reg) {
|
||||
int32_t i = (int32_t) dval;
|
||||
if (dval != i || !(dval >= INT16_MIN && dval <= INT16_MAX))
|
||||
goto do_constant;
|
||||
uint32_t iu = (uint32_t)i;
|
||||
janetc_emit(c,
|
||||
(i << 16) |
|
||||
(iu << 16) |
|
||||
(reg << 8) |
|
||||
JOP_LOAD_INTEGER);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user