Re: [Chicken-hackers] [PATCH] correct size calculation for ffi return types
> On Mon, Jul 31, 2017 at 06:31:28PM +0200, lemonboy wrote: > > Hello hackers, > > I managed to stumble across this nasty compiler bug while trying to figure > > out > > why some code was segfaulting in a FFI stub. It turns out that I forgot to > > place > > a define-foreign-type form before the lines the type was referenced in and > > the > > compiler happily assumed it had size 0 and skipped the generation of the > > scratch > > space buffer. > > Here's a simple patch, I'm not too fond of the catch-all case but it > > shouldn't > > be a problem (the `make check` shows no regression). > > Like I said on IRC, I'm not quite sure what to do with this one. A similar > fix is already part of CHICKEN 5 (5bc3b2d25768f9bd89bafa3b9dd4b85376b0c10a), > see http://lists.gnu.org/archive/html/chicken-hackers/2017-06/msg00081.html > > We could apply the error part to master too, but I don't know what kind > of breakage it will cause. I know it's buggy and probably stupid and > unsafe to leave it, but I'm not sure it's worth risking potentially massive > breakage of existing code that already works. > > What do the other hackers think? When in doubt, I'd leave C4 as it is. felix ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers
Re: [Chicken-hackers] [PATCH] correct size calculation for ffi return types
On Mon, Jul 31, 2017 at 06:31:28PM +0200, lemonboy wrote: > Hello hackers, > I managed to stumble across this nasty compiler bug while trying to figure out > why some code was segfaulting in a FFI stub. It turns out that I forgot to > place > a define-foreign-type form before the lines the type was referenced in and the > compiler happily assumed it had size 0 and skipped the generation of the > scratch > space buffer. > Here's a simple patch, I'm not too fond of the catch-all case but it shouldn't > be a problem (the `make check` shows no regression). Like I said on IRC, I'm not quite sure what to do with this one. A similar fix is already part of CHICKEN 5 (5bc3b2d25768f9bd89bafa3b9dd4b85376b0c10a), see http://lists.gnu.org/archive/html/chicken-hackers/2017-06/msg00081.html We could apply the error part to master too, but I don't know what kind of breakage it will cause. I know it's buggy and probably stupid and unsafe to leave it, but I'm not sure it's worth risking potentially massive breakage of existing code that already works. What do the other hackers think? Cheers, Peter signature.asc Description: PGP signature ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers