mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Fix for CommentSorter crash
This commit is contained in:
parent
bb27721a1f
commit
0df9575f1b
2 changed files with 5 additions and 0 deletions
|
@ -283,6 +283,8 @@ bool CommentSorter::findPosition(Subsort &subsort,Comment *comm,const Funcdata *
|
||||||
if (opiter != fd->endOpAll()) { // If there is an op at or after the comment
|
if (opiter != fd->endOpAll()) { // If there is an op at or after the comment
|
||||||
PcodeOp *op = (*opiter).second;
|
PcodeOp *op = (*opiter).second;
|
||||||
BlockBasic *block = op->getParent();
|
BlockBasic *block = op->getParent();
|
||||||
|
if (block == (BlockBasic *)0)
|
||||||
|
throw LowlevelError("Dead op reaching CommentSorter");
|
||||||
if (block->contains(comm->getAddr())) { // If the op's block contains the address
|
if (block->contains(comm->getAddr())) { // If the op's block contains the address
|
||||||
// Associate comment with this op
|
// Associate comment with this op
|
||||||
subsort.setBlock(block->getIndex(), (uint4)op->getSeqNum().getOrder());
|
subsort.setBlock(block->getIndex(), (uint4)op->getSeqNum().getOrder());
|
||||||
|
@ -295,6 +297,8 @@ bool CommentSorter::findPosition(Subsort &subsort,Comment *comm,const Funcdata *
|
||||||
--opiter;
|
--opiter;
|
||||||
PcodeOp *op = (*opiter).second;
|
PcodeOp *op = (*opiter).second;
|
||||||
BlockBasic *block = op->getParent();
|
BlockBasic *block = op->getParent();
|
||||||
|
if (block == (BlockBasic *)0)
|
||||||
|
throw LowlevelError("Dead op reaching CommentSorter");
|
||||||
if (block->contains(comm->getAddr())) { // If the op's block contains the address
|
if (block->contains(comm->getAddr())) { // If the op's block contains the address
|
||||||
// Treat the comment as being in this block at the very end
|
// Treat the comment as being in this block at the very end
|
||||||
subsort.setBlock(block->getIndex(),0xffffffff);
|
subsort.setBlock(block->getIndex(),0xffffffff);
|
||||||
|
|
|
@ -145,6 +145,7 @@ void Funcdata::stopProcessing(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
flags |= processing_complete;
|
flags |= processing_complete;
|
||||||
|
obank.destroyDead(); // Free up anything in the dead list
|
||||||
#ifdef CPUI_STATISTICS
|
#ifdef CPUI_STATISTICS
|
||||||
glb->stats->process(*this);
|
glb->stats->process(*this);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue