mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +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
|
* @return the lone descendant PcodeOp
|
||||||
*/
|
*/
|
||||||
public PcodeOp getLoneDescend() {
|
public PcodeOp getLoneDescend() {
|
||||||
Iterator<PcodeOp> iter = getDescendants();
|
return null;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -94,6 +94,19 @@ public class VarnodeAST extends Varnode {
|
||||||
return descend.iterator();
|
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
|
@Override
|
||||||
public Address getPCAddress() {
|
public Address getPCAddress() {
|
||||||
if (bInput) {
|
if (bInput) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue