llvmdisas.: Do not put side-effect code into assert(...)
assert(...) can be optimized away, therefore side-effect code should not be placed inside an assertion. Change-Id: I28aee42e53cb105333094d0042a3f6e2cc5b5a30
This commit is contained in:
@ -49,7 +49,9 @@ LLVMtoFailTranslator* LLVMtoFailTranslator::createFromBinary(const std::string e
|
||||
llvm::InitializeAllDisassemblers();
|
||||
|
||||
OwningPtr<Binary> binary;
|
||||
assert(createBinary(elf_path, binary) == 0);
|
||||
llvm::error_code ret = createBinary(elf_path, binary);
|
||||
assert (ret == 0);
|
||||
assert (binary.get() != NULL);
|
||||
|
||||
#ifndef __puma
|
||||
LLVMDisassembler disas(dyn_cast<ObjectFile>(binary.get()));
|
||||
@ -57,4 +59,4 @@ LLVMtoFailTranslator* LLVMtoFailTranslator::createFromBinary(const std::string e
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user