Skip to content

Assert triggered when complex GC roots initialized #3283

@llvmbot

Description

@llvmbot
Bugzilla Link 2911
Resolution LATER
Resolved on Oct 25, 2008 10:07
Version 2.3
OS Windows XP
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

In some GC systems where fat pointers are used to keep track of references within objects, instances of fat pointers may be rooted on the stack to make them visible to the garbage collector. When the root initializer code in the collector base class hits these it will assert because it is not a pointer and a cast<> operation cannot be performed safely. This happens for example with this code:

%FatPointerType = type { i8*, i32 }
declare void @​llvm.gcroot(i8**, i8*) nounwind

define i32 @​TestFunc() gc "somegc"
{
%local_fatpointer = alloca %FatPointerType
%local_fatpointer_ptr = bitcast %FatPointerType* %local_fatpointer to i8**
call void @​llvm.gcroot(i8** %local_fatpointer_ptr, i8* null)

ret i32 0

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions