[Top][All Lists]

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

Re: scm_num2dbl with #f -> segfault

From: Bill Schottstaedt
Subject: Re: scm_num2dbl with #f -> segfault
Date: Sun, 20 Oct 2002 03:41:29 -0700

>> On the Sun (Solaris 2.9), guile 1.6.0, scm_num2dbl segfaults if
>> accidentally passed #f instead of a number.
> I can't reproduce this on GNU/Linux i386.  Could you try to figure out
> why it crashes exactly?

It appears to be a compiler bug.  I was using gcc 2.95 (which comes
with Solaris 2.9), and for the SCM_BIGP macro (which is essentially
(!(6 & val)) && ((val[0] & 0xffff) == scm_tc16_big) or some variation
thereof), the compiler produced:

        andcc   %o2, 6, %o0
        ld      [%o2], %o3
        bne     .LL2472

whereas it should have been more along the lines of:

        andcc   %o2, 6, %o3
        bne     .LL2487
        ld      [%o2], %o1

That is, it was in a big hurry to treat #f as a pointer.
I built gcc 3.2 on that machine and it produces correct-looking

reply via email to

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