chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Fix #1059


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix #1059
Date: Fri, 8 Nov 2013 16:52:39 +0100
User-agent: Mutt/1.4.2.3i

Hi all,

Salmonella discovered another potential source of problems:
the C_c_*vector macros use C_u_i_cdr to extract the actual
bytevector from slot 1 of a SRFI-4 vector.  This is incorrect,
as C_u_i_cdr should only be used for extracting slot 1 from
pair types.

It's not a big deal, but it *will* cause a hard crash when
running programs that use _nonnull_ srfi-4 vector arguments to
foreign lambdas, when compiled under gcc with DEBUGBUILD=1.

The attached patch fixes this by introducing a more generic
accessor macro which can extract the bytevector data from any
SRFI-4 vector type, and used this in all the specific accessors
as well as the generic C_srfi_4_vector_or_null() macro.

This patch also adds a few basic tests, as apparently we don't
have any at all for this FFI type....

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Fix-1059-Use-appropriate-lolevel-accessors-for-SRFI-.patch
Description: Text document


reply via email to

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