Skip to content

clang crashes on assignment of ObjC @​protocol() object to runtime structure #6503

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 6131
Resolution FIXED
Resolved on Sep 02, 2010 07:56
Version trunk
OS Linux
Attachments Testcase to demonstrate the problem, backtrace for the clang crash
Reporter LLVM Bugzilla Contributor
CC @davidchisnall

Extended Description

Hello,

I recently stumbled upon an odd crash with recent clang trunk (r94363) on a 64bit Linux machine, when I was trying to debug some problems with the GNUstep Objective-C runtime. In particular, clang is crashing for me when you try to assign a @​protocol()-object to the corresponding runtime structure like this:

struct objc_protocol *foo = @​protocol(Foo);

I have attached a test case that demonstrates the problem with a reduced definition of struct objc_protocol and the corresponding backtrace from gdb.
I'm also confused as to why clang tries to print a warning here. If I replace
the above with

void foo = (void)@protocol(TestProtocol);

It will print the following error:

protocol.m:12:13: error: initializer element is not a compile-time constant

It would be great if someone had an idea about what is going wrong here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions