mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-30 16:47:43 +08:00
GP-3286 allow larger custom param size in function editor
This commit is contained in:
+12
-12
@@ -227,10 +227,10 @@ public class FunctionEditorModel {
|
|||||||
returnDataTypeSize + "-bytes)";
|
returnDataTypeSize + "-bytes)";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (storageSize > returnDataTypeSize) {
|
else if (storageSize > returnDataTypeSize && storageSize <= 8 && returnDataTypeSize <= 8 &&
|
||||||
statusText = "Too much Return Storage (" + storageSize + "-bytes) for datatype (" +
|
Undefined.isUndefined(returnInfo.getDataType())) {
|
||||||
returnDataTypeSize + "-bytes)";
|
// grow undefined type size if needed
|
||||||
return false;
|
returnInfo.setFormalDataType(Undefined.getUndefinedDataType(storageSize));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -298,20 +298,20 @@ public class FunctionEditorModel {
|
|||||||
return true; // don't constrain float storage size
|
return true; // don't constrain float storage size
|
||||||
}
|
}
|
||||||
|
|
||||||
int requiredSize = datatype.getLength();
|
int paramSize = datatype.getLength();
|
||||||
|
|
||||||
if (storageSize < requiredSize) {
|
if (storageSize < paramSize) {
|
||||||
statusText = "Insufficient storage (" + storageSize + "-bytes) for datatype (" +
|
statusText = "Insufficient storage (" + storageSize + "-bytes) for datatype (" +
|
||||||
requiredSize + "-bytes) assigned to parameter " + (param.getOrdinal() + 1);
|
paramSize + "-bytes) assigned to parameter " + (param.getOrdinal() + 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (requiredSize == 0) {
|
else if (paramSize == 0) {
|
||||||
// assume 0-sized structure which we need to allow
|
// assume 0-sized structure which we need to allow
|
||||||
}
|
}
|
||||||
else if (storageSize > requiredSize) {
|
else if (storageSize > paramSize && storageSize <= 8 && paramSize <= 8 &&
|
||||||
statusText = "Too much storage (" + storageSize + "-bytes) for datatype (" +
|
Undefined.isUndefined(param.getDataType())) {
|
||||||
requiredSize + "-bytes) assigned to parameter " + (param.getOrdinal() + 1);
|
// grow undefined type size if needed
|
||||||
return false;
|
param.setFormalDataType(Undefined.getUndefinedDataType(storageSize));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
-3
@@ -201,18 +201,15 @@ class StorageAddressModel {
|
|||||||
int currentSize = getCurrentSize();
|
int currentSize = getCurrentSize();
|
||||||
if (currentSize == 0) {
|
if (currentSize == 0) {
|
||||||
statusText = "No storage has been allocated";
|
statusText = "No storage has been allocated";
|
||||||
// return false;
|
|
||||||
}
|
}
|
||||||
else if (currentSize > 0 && unconstrained) {
|
else if (currentSize > 0 && unconstrained) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (currentSize < requiredSize) {
|
else if (currentSize < requiredSize) {
|
||||||
statusText = "Warning: Not enough storage space allocated";
|
statusText = "Warning: Not enough storage space allocated";
|
||||||
// return false;
|
|
||||||
}
|
}
|
||||||
else if (currentSize > requiredSize) {
|
else if (currentSize > requiredSize) {
|
||||||
statusText = "Warning: Too much storage space allocated";
|
statusText = "Warning: Too much storage space allocated";
|
||||||
// return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user