[lldb-dev] Infinite recursion causing a crash in Type.cpp

Ted Woodward ted.woodward at codeaurora.org
Fri May 29 13:54:25 PDT 2015


I've got a case where functions in source/Symbol/Type.cpp are calling each
other recursively, and it's blowing the stack.

 

SymbolFileDWARF::ParseType calls GetClangForwardType():

 

    ClangASTType array_element_type = element_type->GetClangForwardType();

 

 

Type::GetClangForwardType() calls ResolveClangType():

 

    ClangASTType 

    Type::GetClangForwardType ()

    {

        ResolveClangType (eResolveStateForward);

        return m_clang_type;

    }

 

 

Type::ResolveClangType() calls GetName():

 

            case eEncodingIsTypedefUID:

                m_clang_type =
encoding_type->GetClangForwardType().CreateTypedefType
(GetName().AsCString(),

 
GetSymbolFile()->GetClangDeclContextContainingTypeUID(GetID()));

                m_name.Clear();

                break;

 

 

Type::GetName() calls GetClangForwardType();

 

    const ConstString &

    Type::GetName()

    {

       if (!m_name)

            m_name = GetClangForwardType().GetConstTypeName();

        return m_name;

    }

 

 

And we go on and on, GetClangForwardType() -> ResolveClangType() ->
GetName() -> GetClangForwardType()->. .

 

Any thoughts on how to fix this?

 

Ted

 

--

Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150529/9b67f803/attachment.html>


More information about the lldb-dev mailing list