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

           Summary: Bitcode reader fails after rev# 78258
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=3301)
 --> (http://llvm.org/bugs/attachment.cgi?id=3301)
IR file that will crash bitcode reader when compiled and read

The attached IR, when compiled to bitcode using LLVM-AS, will crash the
BitcodeReader when the BC is read.  If the source tree is rolled back to 78257
will work fine, but at 78258 or later it will cause an assert here:
       
LLVMTest.exe!llvm::TypeMap<llvm::StructValType,llvm::StructType>::RefineAbstractType(llvm::StructType
* Ty=0x01aed0d0, const llvm::DerivedType * OldType=0x01aeb328, const llvm::Type
* NewType=0x01aeb290)  Line 323 + 0x26 bytes      C++
        LLVMTest.exe!llvm::StructType::refineAbstractType(const
llvm::DerivedType * OldType=0x01aeb328, const llvm::Type * NewType=0x01aeb290) 
Line 1152       C++
        LLVMTest.exe!llvm::DerivedType::unlockedRefineAbstractTypeTo(const
llvm::Type * NewType=0x01aeb290)  Line 1055 + 0x1c bytes     C++
        LLVMTest.exe!llvm::DerivedType::refineAbstractTypeTo(const llvm::Type *
NewType=0x01aeb290)  Line 1076  C++
        LLVMTest.exe!llvm::BitcodeReader::ParseTypeTable()  Line 624    C++
        LLVMTest.exe!llvm::BitcodeReader::ParseModule(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
ModuleID="C:\svn_trunk\Code\Tools\llvm-gcc-helpers\TS.bc")  Line 1270 + 0x8
bytes    C++
        LLVMTest.exe!llvm::BitcodeReader::ParseBitcode()  Line 1521 + 0x42
bytes        C++
        LLVMTest.exe!llvm::getBitcodeModuleProvider(llvm::MemoryBuffer *
Buffer=0x01ae7928, llvm::LLVMContext & Context={...},
std::basic_string<char,std::char_traits<char>,std::allocator<char> > *
ErrMsg="")  Line 2222 + 0x8 bytes C++
        LLVMTest.exe!llvm::ParseBitcodeFile(llvm::MemoryBuffer *
Buffer=0x01ae7928, llvm::LLVMContext & Context={...},
std::basic_string<char,std::char_traits<char>,std::allocator<char> > *
ErrMsg="")  Line 2240 + 0x11 bytes        C++


The code for reading it looks like this:
        memBuf = llvm::MemoryBuffer::getFile("TS.bc");

        std::string errStr;
        mainModule = llvm::ParseBitcodeFile(memBuf, LLVMGetContext(), &errStr);
        if(NULL == mainModule)
        {
                printf("Module errStr: %s\n", errStr.c_str());
                exit(1);
        }


-- 
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