mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GT-3170 Additional refinements to handling of BooleanDataType and
AbstractIntegerDataType
This commit is contained in:
parent
9d2ab478c0
commit
38dd0c177f
8 changed files with 25 additions and 15 deletions
|
@ -323,9 +323,6 @@ class DataDB extends CodeUnitDB implements Data {
|
|||
if (obj instanceof Scalar) {
|
||||
return (Scalar) obj;
|
||||
}
|
||||
else if (obj instanceof Boolean) {
|
||||
return new Scalar(getLength() * 8, ((Boolean) obj).booleanValue() ? 1 : 0);
|
||||
}
|
||||
else if (obj instanceof Address) {
|
||||
Address addrObj = (Address) obj;
|
||||
long offset = addrObj.getAddressableWordOffset();
|
||||
|
|
|
@ -103,8 +103,7 @@ public class BooleanDataType extends AbstractIntegerDataType {
|
|||
|
||||
@Override
|
||||
public String getRepresentation(BigInteger bigInt, Settings settings, int bitLength) {
|
||||
return bigInt.testBit(0) ? "TRUE" : "FALSE";
|
||||
|
||||
return BigInteger.ZERO.equals(bigInt) ? "FALSE" : "TRUE";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,8 +40,8 @@ public class HighConstant extends HighVariable {
|
|||
* @param func the associated high function
|
||||
* @throws InvalidInputException
|
||||
*/
|
||||
public HighConstant(String name, DataType type, Varnode vn, Address pc,
|
||||
HighFunction func) throws InvalidInputException {
|
||||
public HighConstant(String name, DataType type, Varnode vn, Address pc, HighFunction func)
|
||||
throws InvalidInputException {
|
||||
super(name, type, vn, null, func);
|
||||
pcaddr = pc;
|
||||
}
|
||||
|
@ -55,8 +55,8 @@ public class HighConstant extends HighVariable {
|
|||
* @param sym associated dynamic symbol
|
||||
* @throws InvalidInputException
|
||||
*/
|
||||
public HighConstant(String name, DataType type, Varnode vn, Address pc,
|
||||
DynamicSymbol sym) throws InvalidInputException {
|
||||
public HighConstant(String name, DataType type, Varnode vn, Address pc, DynamicSymbol sym)
|
||||
throws InvalidInputException {
|
||||
this(name, type, vn, pc, sym.getHighFunction());
|
||||
symbol = sym;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class HighConstant extends HighVariable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns constant as a scalar object
|
||||
* @return constant as a scalar object
|
||||
*/
|
||||
public Scalar getScalar() {
|
||||
boolean signed = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue