First Last Prev Next    No search results available
Details
: casting a string constant to void crashes llvm-gcc
Bug#: 112
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: 1.0
: P2
: normal
: 1.1

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-11-12 16:14
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.]
------- Comment #1 From Chris Lattner 2003-11-12 16:16:24 -------
Testcase here: test/Regression/CFrontend/2003-11-12-VoidString.c
------- Comment #2 From Chris Lattner 2003-11-12 16:23:20 -------
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?");

First Last Prev Next    No search results available