Skip to content

Commit

Permalink
Fix crash on numeric comparison (ref #2804)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Aug 3, 2023
1 parent ff4bf68 commit 28d358d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jv.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static decContext* tsd_dec_ctx_get(pthread_key_t *key) {
if (key == &dec_ctx_key)
{
decContextDefault(ctx, DEC_INIT_BASE);
ctx->digits = DEC_MAX_DIGITS;
ctx->digits = DEC_MAX_DIGITS - 1;
ctx->traps = 0; /*no errors*/
}
else if (key == &dec_ctx_dbl_key)
Expand Down
4 changes: 4 additions & 0 deletions tests/jq.test
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ null
null
1e+17

5E500000000>5E-5000000000
null
true

25 % 7
null
4
Expand Down

0 comments on commit 28d358d

Please sign in to comment.