64-bit compatibility

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

64-bit compatibility

Alexey Zakhlestin
I get segfault in libgst/oop.c:740 in 64-bit mode.

problem seems to originate here (line 735):
int size = SIZE_TO_BYTES (TO_INT(oop->object->objSize));

looks like TO_INT() macro does something wrong and size is assigned to incorrectly large number…


related definitions:

  objSize is defined as OOP

  typedef struct oop_s *OOP;

  struct oop_s
  {
    gst_object object;
    unsigned long flags; /* FIXME, use uintptr_t */
  };

  #define TO_INT(oop) \
    ((intptr_t)(oop) >> 1)


do I correctly understand, that the problem is related to that "FIXME"?

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: 64-bit compatibility

Paolo Bonzini-2
On 12/10/2009 12:42 AM, Alexey Zakhlestin wrote:

>    struct oop_s
>    {
>      gst_object object;
>      unsigned long flags; /* FIXME, use uintptr_t */
>    };
>
>    #define TO_INT(oop) \
>      ((intptr_t)(oop)>>  1)
>
>
> do I correctly understand, that the problem is related to that "FIXME"?

No, unsigned long is exactly to same size as FIXME and besides flags is
not being accessed anywhere.  Just to be clear, I run on Linux 64-bit
all the time.

Paolo



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk