Menu ▾ ▴

#3370 crash on array declaration with extra braces after function definition

closed-fixed
None
other
5
4 days ago
2022-03-20
No

The following code makes current SDCC crash:

void f (void)
{
}

const int i[]={{1,2},{3,4}};

Depending on the port, I see either a segfault, or an

Internal error: validateLink failed in SPEC_NOUN(type) @ SDCCsymt.c:3819: expected SPECIFIER, got UNKNOWN

Discussion

  • Philipp Klaus Krause

    • summary: crash array on declaration with extra braces after function definition --> crash on array declaration with extra braces after function definition
     
  • Christopher Bazley

    • assigned_to: Christopher Bazley
     
  • Christopher Bazley

    Original brace example produces warning 147 without crashing on MCS51, Z80 and STM8.
    https://godbolt.org/z/38sWK5j7n

     
  • Christopher Bazley

    • status: open --> closed-fixed
     
  • Christopher Bazley

    Added regression test in [r17057]

     

    Related

    Commit: [r17057]


Log in to post a comment.