From 2fd268300e9310a8889956711db0a9f36bb3e29e Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Tue, 22 Feb 2011 02:09:15 +0000 Subject: [PATCH] Fixed llvm-mc in edis mode to use the result of operand.evaluate as an error code, not as the contents of the operand. llvm-svn: 126181 --- tools/llvm-mc/Disassembler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/llvm-mc/Disassembler.cpp b/tools/llvm-mc/Disassembler.cpp index c29d82a2cb3..d76c36155fe 100644 --- a/tools/llvm-mc/Disassembler.cpp +++ b/tools/llvm-mc/Disassembler.cpp @@ -328,7 +328,10 @@ int Disassembler::disassembleEnhanced(const std::string &TS, uint64_t evaluatedResult; void *Arg[] = { disassembler, &Out }; - evaluatedResult = operand->evaluate(evaluatedResult, verboseEvaluator, Arg); + if (operand->evaluate(evaluatedResult, verboseEvaluator, Arg)) { + errs() << "error: Couldn't evaluate an operand\n"; + return -1; + } Out << "=" << evaluatedResult << " "; }