[LLVMbugs] [Bug 11847] New: Crash on invalid in Microsoft anonymous struct extension

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 24 10:35:54 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=11847

             Bug #: 11847
           Summary: Crash on invalid in Microsoft anonymous struct
                    extension
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jason.haslam at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7943
  --> http://llvm.org/bugs/attachment.cgi?id=7943
Possible fix.

The following invalid program crashes clang:

jason$ cat test.c
typedef struct { UNKNOWN c; } A;
typedef struct { A; } B;

jason$ clang -target i386-pc-win32 test.c
test.c:1:18: error: unknown type name 'UNKNOWN'
typedef struct { UNKNOWN c; } A;
                 ^
test.c:2:18: warning: anonymous structs are a Microsoft extension [-Wmicrosoft]
typedef struct { A; } B;
                 ^
Stack dump:
0.    Program arguments: /Users/jason/Sources/llvm/build/release/bin/clang-3.1
-cc1 -triple i386-pc-win32 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.c -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4
-momit-leaf-frame-pointer -resource-dir
/Users/jason/Sources/llvm/build/release/bin/../lib/clang/3.1
-fmodule-cache-path
/var/folders/lf/36_5tdts1953gfg4mjwfmq8h0000gn/T/clang-module-cache
-internal-isystem
/Users/jason/Sources/llvm/build/release/bin/../lib/clang/3.1/include
-internal-isystem C:/Program Files/Microsoft Visual Studio 10.0/VC/include
-internal-isystem C:/Program Files/Microsoft Visual Studio 9.0/VC/include
-internal-isystem C:/Program Files/Microsoft Visual Studio
9.0/VC/PlatformSDK/Include -internal-isystem C:/Program Files/Microsoft Visual
Studio 8/VC/include -internal-isystem C:/Program Files/Microsoft Visual Studio
8/VC/PlatformSDK/Include -fdebug-compilation-dir /Users/jason/Desktop/test
-ferror-limit 19 -fmessage-length 173 -mstackrealign -fms-extensions
-fms-compatibility -fmsc-version=1300 -fdelayed-template-parsing -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/lf/36_5tdts1953gfg4mjwfmq8h0000gn/T/test-Ct8Uam.o -x c test.c 
1.    test.c:2:19: current parser token ';'
2.    test.c:2:9: parsing struct/union body
clang-3: error: unable to execute command: Segmentation fault: 11
clang-3: error: clang frontend command failed due to signal (use -v to see
invocation)
clang-3: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang-3: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang-3: note: diagnostic msg:
/var/folders/lf/36_5tdts1953gfg4mjwfmq8h0000gn/T/test-B8wNe4.i
clang-3: note: diagnostic msg:
/var/folders/lf/36_5tdts1953gfg4mjwfmq8h0000gn/T/test-B8wNe4.sh

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list