-1
嘗試調用函數getLazyBitcodeModule時出現段錯誤。 引起故障的代碼如下所示:調用getlazybitcodemodule時出現段錯誤
// Load the bytecode...
std::string ErrorMsg;
Module *mainModule = 0;
OwningPtr<MemoryBuffer> BufferPtr;
error_code ec = MemoryBuffer::getFileOrSTDIN(InputFile, BufferPtr);
if (ec) {
printf("error loading program '%s': %s\n", InputFile, ec.message().c_str());
exit(1);
}
mainModule = getLazyBitcodeModule(BufferPtr.get(), getGlobalContext(), &ErrorMsg);
的GDB調試信息也顯示如下:
(gdb) backtrace
#0 0x0000000000000241 in ??()
#1 0x000000000040630e in ~OwningPtr (this=0x7fffffffdd20, __in_chrg= <optimized out>) at /usr/local/include/llvm/ADT/OwningPtr.h:45
#2 readBitFile ([email protected]=0xafec23 "test.bc") at main.cpp:36
#3 0x0000000000405fce in main (argc=2, argv=0x7fffffffde78) at main.cpp:71
任何建議來解決這個錯誤嗎?