[Top][All Lists]

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

[Chicken-users] [patch] SDL's FFI misused c-pointer

From: Christian Kellermann
Subject: [Chicken-users] [patch] SDL's FFI misused c-pointer
Date: Sun, 16 Oct 2011 20:48:30 +0200
User-agent: Mutt/1.5.21 (2010-09-15)


I came across a similar situation than my last post about the cairo
egg. Culprit of this week is SDL. I know that there are more people
using SDL than cairo so I am posting the patch against SDL trunk
here first.

The issue is triggered when you provide sdl-fill-rect with a sdl-color
struct instead of a mapped number. (If you do not know what this
means now you are probably fine).

When passing a sdl-color struct to this procedure it results in
passing the pointer of the blob containing the struct data to the
C library. For this a scheme-pointer should be used instead of a

If you do this without the patch you will get a type error as the
FFI checks for the c-pointer tag (thanks for that).

So please SDL users, test this before I will break your nice
application. I think this has never been working before so it should
be ok, but -- just in case -- test.



Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 

Attachment: sdl-scheme-pointer.diff
Description: Text document

reply via email to

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