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:
Christian Dietrich
2014-08-25 12:32:48 +02:00
parent 268d9d4658
commit 0426970dff

View File

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