[Mesa-dev] [PATCH 1/2] gallivm: fix output stream flushing in error case for disassembly.
sroland at vmware.com
sroland at vmware.com
Tue May 13 19:13:30 PDT 2014
From: Roland Scheidegger <sroland at vmware.com>
When there's an error, also need to flush the stream, otherwise an assertion
is hit (meaning you don't actually see the error neither).
---
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
index 7e43b51..e0e40e7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
@@ -227,6 +227,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
if (!AsmInfo) {
Out << "error: no assembly info for target " << Triple << "\n";
+ Out.flush();
return 0;
}
@@ -240,12 +241,14 @@ disassemble(const void* func, llvm::raw_ostream & Out)
OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
if (!MRI) {
Out << "error: no register info for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}
OwningPtr<const MCInstrInfo> MII(T->createMCInstrInfo());
if (!MII) {
Out << "error: no instruction info for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}
#endif
@@ -262,6 +265,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
#endif
if (!DisAsm) {
Out << "error: no disassembler for target " << Triple << "\n";
+ Out.flush();
return 0;
}
@@ -281,6 +285,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
#endif
if (!Printer) {
Out << "error: no instruction printer for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}
--
1.9.1
More information about the mesa-dev
mailing list