chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix allocation size for C_s_a_i_digits_to_integer


From: Jani Hakala
Subject: Re: [PATCH] Fix allocation size for C_s_a_i_digits_to_integer
Date: Sun, 17 Nov 2019 18:12:25 +0200
User-agent: Gnus/5.130013 (Ma Gnus v0.13) Emacs/25.1 (gnu/linux)

Hi,

I found out that there seems to be two similar cases in srfi-4.scm

(define u32vector-ref
  (getter-with-setter
     (lambda (x i) (##core#inline_allocate ("C_a_i_u32vector_ref" 4) x i))
     u32vector-set!
        "(chicken.srfi-4#u32vector-ref v i)"))

(define s32vector-ref
  (getter-with-setter
     (lambda (x i) (##core#inline_allocate ("C_a_i_s32vector_ref" 4) x i))
     s32vector-set!
     "(chicken.srfi-4#s32vector-ref v)))


Since C_a_i_u32vector_ref and C_a_i_s32vector_ref may end up calling
bignum1, there should probably be 5 bytes allocated instead of 4.

I found this by compiling chicken with gcc -fsanitize=address
-fsanitize=aligment, and by linking also related libraries. Address
sanitizer then reported potential problems.

Jani



reply via email to

[Prev in Thread] Current Thread [Next in Thread]