Skip to content

Commit

Permalink
Make encoding of immediate values capture full range.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Jul 14, 2023
1 parent 4efcff3 commit 989f072
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/cfuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static JanetSlot opfunction(
static int can_be_imm(Janet x, int8_t *out) {
if (!janet_checkint(x)) return 0;
int32_t integer = janet_unwrap_integer(x);
if (integer > 127 || integer < -127) return 0;
if (integer > INT8_MAX || integer < INT8_MIN) return 0;
*out = (int8_t) integer;
return 1;
}
Expand Down

0 comments on commit 989f072

Please sign in to comment.