[cfe-commits] [PATCH] Fix for crash on invalid in microsoft anonymous struct extension

Jason Haslam jason.haslam at gmail.com
Tue Jan 31 14:33:15 PST 2012


The attached trivial patch fixes PR 11847. From the PR:

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...
Please apply.

Jason

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120131/ec4d00bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-on-invalid.diff
Type: application/octet-stream
Size: 783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120131/ec4d00bc/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120131/ec4d00bc/attachment-0001.html>


More information about the cfe-commits mailing list