mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
Don't assert if materializing before seeing any function bodies
This assert was reachable from user input. A minimized test case (no FUNCTION_BLOCK_ID record) is attached. Bug found with afl-fuzz llvm-svn: 251910
This commit is contained in:
parent
89688e0631
commit
e813424af3
@ -3055,7 +3055,9 @@ std::error_code BitcodeReader::rememberAndSkipFunctionBodies() {
|
||||
if (Stream.AtEndOfStream())
|
||||
return error("Could not find function in stream");
|
||||
|
||||
assert(SeenFirstFunctionBody);
|
||||
if (!SeenFirstFunctionBody)
|
||||
return error("Trying to materialize functions before seeing function blocks");
|
||||
|
||||
// An old bitcode file with the symbol table at the end would have
|
||||
// finished the parse greedily.
|
||||
assert(SeenValueSymbolTable);
|
||||
|
BIN
test/Bitcode/Inputs/invalid-no-function-block.bc
Normal file
BIN
test/Bitcode/Inputs/invalid-no-function-block.bc
Normal file
Binary file not shown.
@ -207,3 +207,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-alias-type-mismatch.bc 2>&1
|
||||
RUN: FileCheck --check-prefix=ALIAS-TYPE-MISMATCH %s
|
||||
|
||||
ALIAS-TYPE-MISMATCH: Alias and aliasee types don't match
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-function-block.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=NO-FUNCTION-BLOCK %s
|
||||
|
||||
NO-FUNCTION-BLOCK: Trying to materialize functions before seeing function blocks
|
||||
|
Loading…
Reference in New Issue
Block a user