[Vm-dev] Bug in primitiveGetNextEvent?

David T. Lewis lewis at mail.msen.com
Sat Sep 26 16:15:05 UTC 2015


The declaration was recently changed to long, which works on 32 and 64 bit
platforms. The iOS platform code should be changed to match, then all
should be well.

Dave


>  In my test of the iOS VM it have a crash calling primitiveGetNextEvent,
> but only when is SQ_HOST64, I find the problem is because evtBuf is
> declared int:
>
>     int evtBuf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
>
> but pointed by sqInputEvent declared in sq.h as long:
>
> /* generic input event */
> typedef struct sqInputEvent
> {
>   long type;			/* type of event; either one of EventTypeXXX */
>   unsigned long timeStamp;	/* time stamp */
>   /* the longerpretation of the following fields depend on the type of the
> event */
>   long unused1;
>   long unused2;
>   long unused3;
>   long unused4;
>   long unused5;
>   long windowIndex;		/* SmallInteger used in image to identify a host
> window structure */
> } sqInputEvent;
>
> for some reason this works when is SQ_HOST32 but crash when is SQ_HOST64,
> when I change int to long all works OK.
>
> This is in interp.c who is generated by VMMaker:
>
> /* Smalltalk from Squeak4.5 with VMMaker 4.13.12 translated as C source on
> 28 March 2015 8:15:47 pm */
>
> I think one of the declaration needs to be changed.




More information about the Vm-dev mailing list