search for: invalidbitcodesignature

Displaying 9 results from an estimated 9 matches for "invalidbitcodesignature".

2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
...971 ... errs() << "parsebitcodeinto sniff the signature\n"; uint32_t bvar = Stream.Read(8); errs() << "B :" << bvar << "\n"; if (bvar != 'B') { errs() << "B :" << bvar << "\n"; return Error(InvalidBitcodeSignature); } if (Stream.Read(8) != 'C') { errs() << "C\n"; return Error(InvalidBitcodeSignature); } if ( Stream.Read(8) != 0xc0 ) { errs() << "0xc0\n"; return Error(InvalidBitcodeSignature); } if ( Stream.Read(8) != 0xde ) { errs() << "0x...
2016 Feb 09
3
[RFC] Error handling in LLVM libraries.
...more than what we need to pass to the caller. In fact, the > only cases we need to differentiate are "this is not a bitcode file at > all" and "the file is broken", which we do with the following enum + > std::error_code. By contrast, in my system this would be: class InvalidBitcodeSignature : TypedErrorInfo<InvalidBitcodeSignature> {}; class CorruptedBitcode : TypedErrorInfo<CorruptedBitcode> { public: CorruptedBitcode(std::string Msg) : Msg(Msg) {} void log(raw_ostream &OS) const override { OS << Msg; } private: std::string Msg; }; Once you factor out the...
2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
...uint32_t bvar = Stream.Read(8); > errs() << "B :" << bvar << "\n"; > if (bvar != 'B') { > errs() << "B :" << bvar << "\n"; > return Error(InvalidBitcodeSignature); > } > > if (Stream.Read(8) != 'C') { > errs() << "C\n"; > return Error(InvalidBitcodeSignature); > } > if ( Stream.Read(8) != 0xc0 ) { > errs() << "0xc0\n&q...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...= Stream.Read(8); >> errs() << "B :" << bvar << "\n"; >> if (bvar != 'B') { >> errs() << "B :" << bvar << "\n"; >> return Error(InvalidBitcodeSignature); >> } >> >> if (Stream.Read(8) != 'C') { >> errs() << "C\n"; >> return Error(InvalidBitcodeSignature); >> } >> if ( Stream.Read(8) != 0xc0 ) { >>...
2014 Mar 13
2
[LLVMdev] load bytecode from string for jiting problem
Hello, I having a weird problem while writing a bytecode module to a string, and after read/parse it for unsing on a jit. I write a pass to export function to module, and put this module inside a global variable. I use WriteBitcodeToFile for this. For debuging, after this write, I try to load the exported module with parseBitcodeFile. This two step works. After, while the compiled program is
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...errs() << "B :" << bvar << "\n"; >>>> if (bvar != 'B') { >>>> errs() << "B :" << bvar << "\n"; >>>> return Error(InvalidBitcodeSignature)__; >>>> >>>> } >>>> >>>> if (Stream.Read(8) != 'C') { >>>> errs() << "C\n"; >>>> return Error(InvalidBitcodeSignature)__;...
2016 Feb 10
5
[RFC] Error handling in LLVM libraries.
...c depends on whether a caller can handle the corresponding error, > > which isn't something you know at the point where the error is raised. > But you do in the diag handler. For example, if you are trying to open > multiple files, some of which are bitcode, you know to ignore > InvalidBitcodeSignature. That means anticipating the kinds of errors you do/don't want to recover from at the point at which you insatiate your diagnostic handler. At that point you may not have the information that you need to know whether you want to recover. E.g. What if one path through library code can recover,...
2016 Feb 03
6
[RFC] Error handling in LLVM libraries.
Hi Mehdi, > If you subclass a diagnostic right now, isn’t the RTTI information available to the handler, which can then achieve the same dispatching / custom handling per type of diagnostic? > (I’m not advocating the diagnostic system, which I found less convenient to use than what you are proposing) I have to confess I haven't looked at the diagnostic classes closely. I'll take a
2015 May 29
9
[LLVMdev] Error handling in LLVMObject library
Hi everyone, Having proper error handling in LLVM's Object parsing library is a nice thing by itself, but it would additionally allow us to find bugs by fuzzing (see r238451 that adds llvm-dwarfdump-fuzzer tool), for which the clean input validation is essential. This is a generic discussion of state of affairs. I want to do some progress in fuzzing before we finish it (especially if we