Menu ▾ ▴

#3013 SIGSEGV when attempting to pass struct from array to varargs function

closed-fixed
None
other
5
2024-12-30
2020-06-03
No
struct some_struct
{
    int i;
};

void f(int n, ...);

int main()
{
    struct some_struct x[1];
    f(0, x[0]);
}

Compiling this with sdcc-sdcc test.c gives a SIGSEGV with the version being SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.0.0 #11528 (Linux)

Discussion

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    We've had a lot of fixes for struct parameters since. This works now, and I've also added a regression test for it in [r15194].

     

    Related

    Commit: [r15194]


    Last edit: Philipp Klaus Krause 2025-02-09

Log in to post a comment.