1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-07 20:42:54 +00:00
This commit is contained in:
Calvin Rose 2025-04-11 22:44:36 -05:00
parent 3cbdf26aa2
commit c9305a0a42
2 changed files with 49 additions and 50 deletions

View File

@ -1087,8 +1087,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
switch (janet_type(constant)) {
default:
return 0;
case JANET_TUPLE:
{
case JANET_TUPLE: {
const Janet *elements = janet_unwrap_tuple(constant);
int32_t len = janet_tuple_length(elements);
if (p != JANET_PRIM_ARRAY) return 0;
@ -1104,8 +1103,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
case JANET_SYMBOL:
case JANET_POINTER:
return p == JANET_PRIM_POINTER;
case JANET_NUMBER:
{
case JANET_NUMBER: {
double x = janet_unwrap_number(constant);
if (p == JANET_PRIM_F64) return 1;
if (p == JANET_PRIM_F32) return 1;
@ -1120,8 +1118,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
if (p == JANET_PRIM_S64 && (x >= INT64_MIN && x <= INT64_MAX)) return 1;
return 0;
}
case JANET_ABSTRACT:
{
case JANET_ABSTRACT: {
void *point = janet_unwrap_abstract(constant);
const JanetAbstractType *at = janet_abstract_type(point);
if (at == &janet_s64_type && p == JANET_PRIM_S64) return 1;

View File

@ -363,7 +363,9 @@ static void e_mov_to_reg(JanetSysx64Context *ctx, x64Reg d, x64Reg s, MoveMode m
return;
}
if (mm == MOV_LOAD || s.storage != JANET_SYSREG_REGISTER) {
x64Reg t = d; d = s; s = t; /* swap */
x64Reg t = d;
d = s;
s = t; /* swap */
flip = 1;
}
assert(s.storage == JANET_SYSREG_REGISTER);