Hi Dennis,

> Le 13 oct. 2021 à 00:19, Dennis Clarke <[email protected]> a écrit :
> 
> On 10/9/21 04:35, Akim Demaille wrote:
>> Hi Dennis,
>> 
>> Thanks for this bug report.
> 
> The least I can do.

:)

> You will love this :
> 
> p = 0x100104410
> (dbx) print *p
> *p = {
>    name  = 0x105bd0 "<bad address 0x0000000000105bd0>"
>    type  = 260
>    value = {
>        var = 2.1225218246347e-314
>        fun = 0x100103f00
>    }
>    next  = 0x1001043e0
> }
> (dbx) quit
> beta $

Well, maybe the problem is actually very simple: the sym_table pointer is not 
initialized to NULL by the compiler.  And as a matter of fact, it is probably 
right, I don't believe the C standard requires it to do it.  It is mandatory 
for static variables, but that's not the case here.

Could you look for the following lines in examples/c/mfcalc/mfcalc.y

/* The symbol table: a chain of 'struct symrec'. */
symrec *sym_table;

and turn it into this?

/* The symbol table: a chain of 'struct symrec'. */
symrec *sym_table = NULL;

That should do it.  Thanks!

Reply via email to