clang bus error

Hi,

$ cat test.m
int main() {
   @"bla";
}
$./clang test.m
running "/Users/nico/src/llvm-svn/Debug/bin/clang -fsyntax-only test.m"
0 clang 0x0021ee1d _ZN40_GLOBAL__N_Signals.cpp_00000000_6071175B15PrintStackTraceEv + 45
1 clang 0x0021f1c3 _ZN40_GLOBAL__N_Signals.cpp_00000000_6071175B13SignalHandlerEi + 323
2 libSystem.B.dylib 0x94e6197b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 clang 0x000fa627 _ZN5clang6Parser27ParseStatementOrDeclarationEb + 605
5 clang 0x000f9f10 _ZN5clang6Parser26ParseCompoundStatementBodyEb + 124
6 clang 0x000fa280 _ZN5clang6Parser26ParseFunctionStatementBodyEPvNS_14SourceLocationES2_ + 26
7 clang 0x000fdfdc _ZN5clang6Parser23ParseFunctionDefinitionERNS_10DeclaratorE + 418
8 clang 0x000fe2c4 _ZN5clang6Parser36ParseDeclarationOrFunctionDefinitionEv + 730
9 clang 0x000fe41d _ZN5clang6Parser24ParseExternalDeclarationEv + 83
10 clang 0x000fe5f9 _ZN5clang6Parser17ParseTopLevelDeclERPv + 61
11 clang 0x0007b76c _ZN37_GLOBAL__N__ZN5clang11ASTConsumerD2Ev11ASTStreamer16ReadTopLevelDeclEv + 24
12 clang 0x0007b8be _ZN5clang8ParseASTERNS_12PreprocessorEjPNS_11ASTConsumerEb + 272
13 clang 0x0002326f _ZN4llvm15BitstreamWriter4EmitEjj + 5363
14 clang 0x000251c1 main + 1321
15 clang 0x00002362 start + 54
./clang: line 35: 31432 Bus error $command

Nico

$ cat test.m
int main() {
  @"bla";
}
$./clang test.m
running "/Users/nico/src/llvm-svn/Debug/bin/clang -fsyntax-only test.m"
0 clang 0x0021ee1d
_ZN40_GLOBAL__N_Signals.cpp_00000000_6071175B15PrintStackTraceEv + 45
1 clang 0x0021f1c3

*snip*

./clang: line 35: 31432 Bus error $command

The attached patch fixes this problem. I'm not sure if I've put the test in the right place since it's a regression test for the parser pretending to be a sema test. Feel free to put it somewhere else.

Nico

unused_nsstring.patch (1.03 KB)