[clang] [clang][bytecode] Fix crash on arrays with excessive size (PR #175402)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 11 00:23:52 PST 2026


================
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -fsyntax-only %s
+// RUN: %clang_cc1 -fsyntax-only %s
+
+// This test checks that we don't crash when encountering arrays with
+// sizes that exceed the bytecode interpreter's limits.
+// See: https://github.com/llvm/llvm-project/issues/175293
+
+char q[-2U];
+
+void foo() { char *p = q + 1; }
----------------
tbaederr wrote:

Add this to e.g. `codegen.cpp` instead,  and test `q` has the proper size.

https://github.com/llvm/llvm-project/pull/175402


More information about the cfe-commits mailing list