llvm / llvm/llvm-project

Clang crash on global-scope statement with ellipsis ('...')

Open
#182,154 4 comments 0 reactions 0 assignees View on GitHub
clang:frontend crash generated by fuzzer
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

- crash on invalid input
- bug found from fuzzing

## Minimized Code
```c
g(h(x)...)
```
## Full Example Code
```c
int g(int);
int h(int);
int x = 0;
g(h(x)...); // crash
```
Note:
- Crash only found in clang, not present in clang++
- If the same statement is moved inside a function (ex. main()), or assigned to a variable, the crash does not occur.

## CompilerExplorer
https://godbolt.org/z/j7q9Pcfh1

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash with the minimized code and the full example in Clang, using the linked CompilerExplorer case if helpful. Compare the same inputs in clang++ and with the statement moved inside a function or assigned to a variable; done means the global-scope ellipsis input no longer crashes and the relevant regression coverage passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.