GP-3873 Data-type alignment support in decompiler

This commit is contained in:
caheckman 2023-09-22 16:08:18 +00:00
parent 6508088623
commit 64a58bdeab
29 changed files with 456 additions and 149 deletions

View file

@ -449,7 +449,7 @@ void ScoreUnionFields::scoreTrialDown(const Trial &trial,bool lastLevel)
}
}
TypePointer *baseType = (TypePointer *)trial.fitType;
if (baseType->getPtrTo()->getSize() == elSize) {
if (baseType->getPtrTo()->getAlignSize() == elSize) {
score = 5;
resType = trial.fitType;
}
@ -601,7 +601,7 @@ void ScoreUnionFields::scoreTrialDown(const Trial &trial,bool lastLevel)
if (meta == TYPE_PTR) {
if (trial.inslot == 0) {
Datatype *ptrto = ((TypePointer *)trial.fitType)->getPtrTo();
if (ptrto->getSize() == trial.op->getIn(2)->getOffset()) {
if (ptrto->getAlignSize() == trial.op->getIn(2)->getOffset()) {
score = 10;
resType = trial.fitType;
}
@ -812,7 +812,7 @@ void ScoreUnionFields::scoreTrialUp(const Trial &trial,bool lastLevel)
case CPUI_PTRADD:
if (meta == TYPE_PTR) {
Datatype *ptrto = ((TypePointer *)trial.fitType)->getPtrTo();
if (ptrto->getSize() == def->getIn(2)->getOffset())
if (ptrto->getAlignSize() == def->getIn(2)->getOffset())
score = 10;
else
score = 2;