#19 half fix for bug 770487

closed-accepted
nobody
None
5
2004-05-31
2004-05-13
No

Hi,

After fixing bug 770484, this related bug was easily
spotted. SDCC tries to get the name of an array in a
struct which is not an AST_SYM_VALUE. This generates
an access violation / SIGSEGV. This patch validates the
pointers before dereferencing them, solving the crash.

It does not however fully solve the issue. While
generating initialization code for the first array, it's
length is determined and stored in the type. When it
generates initialization code for a next instance it no
longer is of unspecified length. And if the latter is
longer, SDCC still warns about too many initializers and
truncates the initialization. A work-around is to define
the largest struct (with the largest array) first.

Greetings,
Maarten

Discussion

  • Maarten Brock

    Maarten Brock - 2004-05-13

    patched and untabified SDCCast.c

     
  • Maarten Brock

    Maarten Brock - 2004-05-31
    • status: open --> closed-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks