summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/quickjs.c b/quickjs.c
index 1af08ec..4837885 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -48100,8 +48100,11 @@ static int string_get_signed_digits(JSString *sp, int *pp, int64_t *pval) {
p++;
res = string_get_digits(sp, &p, pval);
- if (res == 0 && sgn == '-')
+ if (res == 0 && sgn == '-') {
+ if (*pval == 0)
+ return -1; // reject negative zero
*pval = -*pval;
+ }
*pp = p;
return res;
}