mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-2021 varnode null issue refactor
This commit is contained in:
parent
bb79314d85
commit
fb15d5eb06
2 changed files with 14 additions and 9 deletions
|
@ -292,15 +292,7 @@ public class Varnode {
|
|||
* @return the lone descendant PcodeOp
|
||||
*/
|
||||
public PcodeOp getLoneDescend() {
|
||||
Iterator<PcodeOp> iter = getDescendants();
|
||||
if (!iter.hasNext()) {
|
||||
return null; // If there are no descendants return null
|
||||
}
|
||||
PcodeOp op = iter.next();
|
||||
if (iter.hasNext()) {
|
||||
return null; // If there is more than one descendant return null
|
||||
}
|
||||
return op;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -93,6 +93,19 @@ public class VarnodeAST extends Varnode {
|
|||
public Iterator<PcodeOp> getDescendants() {
|
||||
return descend.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PcodeOp getLoneDescend() {
|
||||
Iterator<PcodeOp> iter = getDescendants();
|
||||
if (!iter.hasNext()) {
|
||||
return null; // If there are no descendants return null
|
||||
}
|
||||
PcodeOp op = iter.next();
|
||||
if (iter.hasNext()) {
|
||||
return null; // If there is more than one descendant return null
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Address getPCAddress() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue