Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete struct types #2844

Open
nurmukhametov opened this issue May 1, 2024 · 0 comments
Open

Incomplete struct types #2844

nurmukhametov opened this issue May 1, 2024 · 0 comments
Labels
Bugs Crash All compiler crashes

Comments

@nurmukhametov
Copy link
Collaborator

nurmukhametov commented May 1, 2024

The following examples are crashed:

struct S1 { struct S2 a; };
struct S1 func() {
    struct S1 x;
    return x;
}
struct Sx bar() {}
int boo(struct Sy) {}
int foo() { struct Sx x; }

I guess the reason for all of them is same. By some reason, ISPC doesn't check the usage of incomplete structs types on AST level. So, LLVM IR is incorrect:

Cannot allocate unsized type
  %7 = alloca %v4_varying_Sx, align 8
LLVM ERROR: Broken module found, compilation aborted!

This example is compiled but shouldn't. It has to generate the compiler error "error: field 'a' has incomplete type 'S2'"

struct S1 { struct S2 a; };

We also want to generate warning like this "Error: Enum type "Ab" unknown. Did you mean "Aa"" when user misspels struct type name.

@nurmukhametov nurmukhametov added the Crash All compiler crashes label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugs Crash All compiler crashes
Projects
None yet
Development

No branches or pull requests

1 participant