diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index 406f3e33399b..0f16db90940a 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -57,9 +57,13 @@ int main(int argc, char **argv) { return 1; } - if (!DisableVerify && verifyModule(*M.get(), PrintMessageAction)) { + try { + if (!DisableVerify) + verifyModule(*M.get(), ThrowExceptionAction); + } catch (const std::string &Err) { std::cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n"; + std::cerr << Err; return 1; }