mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch 'origin/Ghidra_9.2'
This commit is contained in:
commit
b605ad0327
25 changed files with 408 additions and 252 deletions
|
@ -125,12 +125,19 @@ public final class DataUtilities {
|
|||
existingDataLen = data.getLength();
|
||||
existingDT = data.getDataType();
|
||||
|
||||
if (data.isDefined() && newDataType.isEquivalent(existingDT)) {
|
||||
return data;
|
||||
}
|
||||
|
||||
// Check for external reference on pointer
|
||||
Reference[] refs = refMgr.getReferencesFrom(addr);
|
||||
for (Reference ref : refs) {
|
||||
if (ref.getOperandIndex() == 0 && ref.isExternalReference()) {
|
||||
extRef = ref;
|
||||
break;
|
||||
if (existingDT instanceof Pointer) {
|
||||
// TODO: This can probably be eliminated
|
||||
Reference[] refs = refMgr.getReferencesFrom(addr);
|
||||
for (Reference ref : refs) {
|
||||
if (ref.getOperandIndex() == 0 && ref.isExternalReference()) {
|
||||
extRef = ref;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,11 +199,11 @@ public final class DataUtilities {
|
|||
private static void checkEnoughSpace(Program program, Address addr, int existingDataLen,
|
||||
DataTypeInstance dti, ClearDataMode mode) throws CodeUnitInsertionException {
|
||||
Listing listing = program.getListing();
|
||||
int newSize = dti.getLength();
|
||||
if (newSize <= existingDataLen) {
|
||||
listing.clearCodeUnits(addr, addr, false);
|
||||
return;
|
||||
}
|
||||
// int newSize = dti.getLength();
|
||||
// if (newSize <= existingDataLen) {
|
||||
// listing.clearCodeUnits(addr, addr, false);
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
Address end = addr.addNoWrap(existingDataLen - 1);
|
||||
Address newEnd = addr.addNoWrap(dti.getLength() - 1);
|
||||
|
|
|
@ -60,7 +60,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
|||
* organization when resolved.
|
||||
*/
|
||||
public PointerDataType() {
|
||||
this(null, -1, null);
|
||||
this(DataType.DEFAULT, -1, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,7 +72,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
|||
* @param dtm data-type manager whose data organization should be used
|
||||
*/
|
||||
public PointerDataType(DataTypeManager dtm) {
|
||||
this(null, -1, dtm);
|
||||
this(DataType.DEFAULT, -1, dtm);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final DataType clone(DataTypeManager dtm) {
|
||||
public final Pointer clone(DataTypeManager dtm) {
|
||||
if (dtm == getDataTypeManager()) {
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue