#1088 SIGSEGV on wrong code

closed-fixed
5
2013-05-25
2006-04-08
No

Hi.

This code (attached) makes sdcc to segfault:
---
union u t[2] = { { 1, 2 }, { 1, 2 } };

unsigned char main()
{
return 0;
}
---

$ sdcc sg.c
Caught signal 11: SIGSEGV

Discussion

  • Stas Sergeev

    Stas Sergeev - 2006-04-08

    a test-case

     
  • Maarten Brock

    Maarten Brock - 2008-02-21

    Logged In: YES
    user_id=888171
    Originator: NO

    Since the union was not yet defined before it is created here with no member fields. And thus any initializer is one too many.

    Fixed in SDCC 2.7.5 #5037 by generating a proper error.

     
  • Maarten Brock

    Maarten Brock - 2008-02-21
    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     

Log in to post a comment.