LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 18762 - Crash in StmtPrinter where some record member-access has been parsed as a pseudo Objective-C message
Summary: Crash in StmtPrinter where some record member-access has been parsed as a pse...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: unspecified
Hardware: All All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 13:32 PST by mathieu.baudet
Modified: 2014-02-06 18:13 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
Stack trace with my local compilation of clang 3.4 (8.42 KB, text/plain)
2014-02-06 13:32 PST, mathieu.baudet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mathieu.baudet 2014-02-06 13:32:52 PST
Created attachment 12027 [details]
Stack trace with my local compilation of clang 3.4

Printing the AST of the following Objective-C program crashes clang 3.3 (Apple Xcode 5) and my local version of clang 3.4 (see stack trace with symbols).

The issue transposes to a crash of the AST dumper when the problematic expression "A.foo.x" is moved into a __typeof__().

Not sure if the bug is about the printer or the parser. (The AST looks weird to me in first place.)


cat >test.m << EOF
struct S { int x; };

@interface A
+ (struct S)foo;
@end

void f() {
  int _y = A.foo.x;
}
EOF

clang -Xclang -ast-print -c test.m
Comment 1 rtrieu 2014-02-06 17:29:26 PST
Fixed in 200953.  -ast-print now outputs:

struct S {
    int x;
};
@interface A+ (struct S) foo;
 @end
void f() {
    int _y = A.foo.x;
}
Comment 2 mathieu.baudet 2014-02-06 18:13:12 PST
Faster than light. Thanks!