Browse Source

gallivm: abort properly when running out of buffer space in lp_disassembly

Before this actually ran into an infinite loop printing out "invalid"...

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
tags/10.6-branchpoint
Roland Scheidegger 11 years ago
parent
commit
2372275d2f
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

+ 8
- 4
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp View File

@@ -399,19 +399,23 @@ disassemble(const void* func, llvm::raw_ostream & Out)
break;
}
}

if (pc >= extent) {
Out << "disassembly larger than " << extent << "bytes, aborting\n";
break;
}
}

Out << "\n";
Out.flush();

/*
* Print GDB command, useful to verify output.
*/

if (0) {
_debug_printf("disassemble %p %p\n", bytes, bytes + pc);
}

Out << "\n";
Out.flush();

return pc;
}


Loading…
Cancel
Save