mirror of https://github.com/WerWolv/ImHex.git
patterns: Fixed pointers not working correctly
This commit is contained in:
parent
9dc62e1469
commit
ba97573f93
|
@ -943,15 +943,29 @@ namespace hex::pl {
|
||||||
}, offset->getValue());
|
}, offset->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto offset = evaluator->dataOffset();
|
||||||
|
|
||||||
auto sizePattern = this->m_sizeType->createPatterns(evaluator).front();
|
auto sizePattern = this->m_sizeType->createPatterns(evaluator).front();
|
||||||
ON_SCOPE_EXIT { delete sizePattern; };
|
ON_SCOPE_EXIT { delete sizePattern; };
|
||||||
|
|
||||||
auto pattern = new PatternDataPointer(evaluator->dataOffset(), sizePattern->getSize());
|
auto pattern = new PatternDataPointer(offset, sizePattern->getSize());
|
||||||
pattern->setPointedAtPattern(this->m_type->createPatterns(evaluator).front());
|
offset = evaluator->dataOffset();
|
||||||
|
|
||||||
|
{
|
||||||
|
auto pointedAtPattern = this->m_type->createPatterns(evaluator).front();
|
||||||
|
u128 pointerAddress = 0;
|
||||||
|
evaluator->getProvider()->read(pattern->getOffset(), &pointerAddress, pattern->getSize());
|
||||||
|
pointedAtPattern->setOffset(pointerAddress);
|
||||||
|
|
||||||
|
pattern->setPointedAtPattern(pointedAtPattern);
|
||||||
|
}
|
||||||
|
|
||||||
pattern->setVariableName(this->m_name);
|
pattern->setVariableName(this->m_name);
|
||||||
|
|
||||||
applyVariableAttributes(evaluator, this, pattern);
|
applyVariableAttributes(evaluator, this, pattern);
|
||||||
|
|
||||||
|
evaluator->dataOffset() = offset;
|
||||||
|
|
||||||
return { pattern };
|
return { pattern };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue