Skip to content

Commit

Permalink
Update WZ-applied QuickJS patches
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Feb 17, 2024
1 parent 0a34357 commit 6b63027
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions patches/011-fix-compile-without-bignum.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/libbf.c b/libbf.c
--- a/libbf.c
+++ b/libbf.c
@@ -3103,9 +3103,15 @@ static int bf_atof_internal(bf_t *r, slimb_t *pexponent,
expn = -expn;
}
if (is_dec) {
+#ifdef USE_BF_DEC
a->expn = expn + int_len;
a->sign = is_neg;
ret = bfdec_normalize_and_round((bfdec_t *)a, prec, flags);
+#else
+ // bfdec_normalize_and_round not available without USE_BF_DEC
+ bf_set_nan(r);
+ ret = BF_ST_MEM_ERROR;
+#endif
} else if (radix_bits) {
/* XXX: may overflow */
if (!is_bin_exp)
1 change: 1 addition & 0 deletions patches/apply_quickjs_patches.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ quickjs_apply_patches(
"008-bsd-compile-fixes.patch"
"009-asan-compatibility.patch"
"010-win32-gmtime-nullcheck.patch"
"011-fix-compile-without-bignum.patch"
)

# Finally, rename VERSION to VERSION.txt
Expand Down

0 comments on commit 6b63027

Please sign in to comment.