Menu

#1132 sdcc loops creating new symbol

closed-fixed
5
2014-08-14
2006-05-28
rbras
No

1.
typedef struct _NODE
{
const unsigned char type;
const unsigned char name[8];
const struct _NODE * const enter;
const struct _NODE * const down;
const struct _NODE * const up;
}NODE;

extern const NODE node1;
extern const NODE node2;

//sdcc loops allocating space for new symbols node1 and
//zzz until there is no more memory, then segfaults
//
//The reference to zzz inside the declaration of zzz
//triggers a loop allocating space for symbols node1
//and zzz
const NODE zzz = {4, {'x', 'p', 't','o',0},&node1 ,
&zzz, &node2};

void Config()
{
}

2.
I tried with differenet architectures and the result was
the same.

ex: sdcc -mpic16 -p18f452 -c lixo1.c

3.
$ sdcc --version
SDCC:mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.5.6 #4195 (May 28 2006) (UNIX)

4.
sdcc -mpic16 -p18f452 -c lixo1.c
Segmentation fault

see coments in the code for the explanatio of the
segmentation fault.

The code is valid. It works with microchip and hi-tech
compilers.

Discussion

  • Maarten Brock

    Maarten Brock - 2006-06-24

    Logged In: YES
    user_id=888171

    Fixed in SDCC 2.5.6 #4246.

     
  • Maarten Brock

    Maarten Brock - 2006-06-24
    • milestone: --> 100457
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     
  • rbras

    rbras - 2006-07-08

    Logged In: YES
    user_id=1530099

    This bug is not fixed for the pic architecture. sdcc still
    gives a segmentation fault using sdcc -mpic16 -p18f452

     
  • rbras

    rbras - 2006-07-08
    • status: closed-fixed --> closed-wont-fix
     
  • rbras

    rbras - 2006-07-08
    • milestone: 100457 -->
    • status: closed-wont-fix --> open-wont-fix
     
  • Maarten Brock

    Maarten Brock - 2006-07-08
    • milestone: --> fixed
    • labels: --> C-Front End
    • status: open-wont-fix --> closed-fixed
     
  • Maarten Brock

    Maarten Brock - 2006-07-08

    Logged In: YES
    user_id=888171

    Sorry, I forgot the PIC ports have their own glue.c. Fixed
    in SDCC 2.5.6 #4280.

     

Log in to post a comment.