llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open apbenson00 opened this issue 9 months ago • 4 comments

  • crash on invalid input
  • bug found from fuzzing

Minimized Code

g(h(x)...)

Full Example Code

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

apbenson00 avatar Feb 18 '26 21:02 apbenson00

@llvm/issue-subscribers-clang-frontend

Author: Andy Benson (apbenson00)

- crash on invalid input - bug found from fuzzing

Minimized Code

g(h(x)...)

Full Example Code

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

llvmbot avatar Feb 18 '26 21:02 llvmbot

May I pick up this issue?

csxplorer avatar Feb 19 '26 01:02 csxplorer

May I pick up this issue?

We assign issues after there is a PR and we check that it is headed in the right direction.

zwuis avatar Feb 20 '26 13:02 zwuis

May I pick up this issue?

We assign issues after there is a PR and we check that it is headed in the right direction.

Okay, thanks. Since @Ayush3941 's fix seems to solve this issue, I would seek other problems for contribution.

csxplorer avatar Feb 20 '26 14:02 csxplorer