Hi all, Here's a fix for the allocation size for C_s_a_i_digits_to_integer. It was marked as needing 5 words, but it will need 6 words at most.
This was reported by jjhoo on IRC, found by running CHICKEN under Valgrind. Potentially this may fix #1637. Cheers, Peter
From ba1253332d42e1296513d29ac85d201fab9c8e46 Mon Sep 17 00:00:00 2001 From: Peter Bex <pe...@more-magic.net> Date: Sun, 17 Nov 2019 12:54:19 +0100 Subject: [PATCH] Fix allocation size for C_s_a_i_digits_to_integer Found by jjhoo using Valgrind: C_bignum2 needs 4 words (header, sign and the two digit words), plus the 2 words for the bignum wrapper. --- library.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.scm b/library.scm index 29b85878..c501ab6e 100644 --- a/library.scm +++ b/library.scm @@ -2468,7 +2468,7 @@ EOF (end (or hashes digits))) (and-let* ((end) (num (##core#inline_allocate - ("C_s_a_i_digits_to_integer" 5) + ("C_s_a_i_digits_to_integer" 6) str start (car end) radix neg?))) (when hashes ; Eeewww. Feeling dirty yet? (set! seen-hashes? #t) @@ -2482,7 +2482,7 @@ EOF (and-let* ((start (if sign (fx+ start 1) start)) (end (scan-digits start))) (cons (##core#inline_allocate - ("C_s_a_i_digits_to_integer" 5) + ("C_s_a_i_digits_to_integer" 6) str start (car end) radix (eq? sign 'neg)) (cdr end))))))) (scan-decimal-tail ; The part after the decimal dot -- 2.20.1
signature.asc
Description: PGP signature