Bugzilla – Bug 112
casting a string constant to void crashes llvm-gcc
Last modified: 2003-11-12 16:23:20
You need to log in before you can comment on or make changes to this bug.
Testcase: static void query_newnamebuf(void) { ((void)"query_newnamebuf"); } How to reproduce bug: copy the above line into foobar.i and run: > llvm-gcc foobar.i and you will see: foobar.i: In function `query_newnamebuf': foobar.i:4: internal compiler error: Segmentation fault Please submit a full bug report, [yadda yadda yadda.]
Testcase here: test/Regression/CFrontend/2003-11-12-VoidString.c
This is now fixed. The patch: $ diff -u llvm-expand.c~ llvm-expand.c --- llvm-expand.c~ 2003-11-08 22:13:27.000000000 -0600 +++ llvm-expand.c 2003-11-12 16:21:24.000000000 -0600 @@ -5064,7 +5064,8 @@ break; case STRING_CST: - llvm_expand_constructor(Fn, exp, DestLoc, 0); + if (DestLoc) + llvm_expand_constructor(Fn, exp, DestLoc, 0); break; case CONSTRUCTOR: assert(isDestTyComposite && "Constructor for non-composite type?");