http://llvm.org/bugs/show_bug.cgi?id=8761

           Summary: clang_getCursorSemanticParent segfaults
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


I'm observing a segmentation fault in clang_getCursorSemanticParent().
The cursor kind is CXCursor_UnexposedDecl. The getDeclContext() call returns 0,
so the following call to cast<Decl>(DC) fails. (Ironically, it's the
"assert(isa<X>(Val) && "...") check itself that causes the error, as it
dereferences Val, which is 0.

Also, a somewhat related issue: The documentation isn't quite clear on what the
returned-value for getCursorSemanticParent() will be for global declarations.
Should it return a null-cursor ? Or the argument itself ?
(I'm trying to write a function that walks up the context stack to build the
fully qualified name for a given declared name.)

Thanks,

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to