larmel / lacc

A simple, self-hosting C compiler
MIT License
887 stars 64 forks source link

Compound literal in initializer #14

Closed michaelforney closed 5 years ago

michaelforney commented 5 years ago

Test case:

int main(void) {
    int a[] = {1, (int){2}};
    return a[0] != 1;
}

Instead of {1, 2}, a gets initialized to {0, 2}.

larmel commented 5 years ago

Thank you for reporting! This is fixed with 2287ab34.