mirror of https://github.com/WerWolv/ImHex.git
patterns: Fixed wrong offsets when passing custom types to functions
This commit is contained in:
parent
a29e3789d2
commit
2dc1886ee9
|
@ -689,10 +689,13 @@ namespace hex::pl {
|
|||
}
|
||||
|
||||
void setOffset(u64 offset) override {
|
||||
for (auto &entry : this->m_entries) {
|
||||
entry->setOffset(offset + (entry->getOffset() - this->getOffset()));
|
||||
if (!this->isLocal()) {
|
||||
for (auto &entry : this->m_entries) {
|
||||
entry->setOffset(offset + (entry->getOffset() - this->getOffset()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PatternData::setOffset(offset);
|
||||
}
|
||||
|
||||
|
@ -956,8 +959,10 @@ namespace hex::pl {
|
|||
}
|
||||
|
||||
void setOffset(u64 offset) override {
|
||||
for (auto &member : this->m_members) {
|
||||
member->setOffset(offset + (member->getOffset() - this->getOffset()));
|
||||
if (!this->isLocal()) {
|
||||
for (auto &member: this->m_members) {
|
||||
member->setOffset(offset + (member->getOffset() - this->getOffset()));
|
||||
}
|
||||
}
|
||||
|
||||
PatternData::setOffset(offset);
|
||||
|
@ -1093,8 +1098,10 @@ namespace hex::pl {
|
|||
}
|
||||
|
||||
void setOffset(u64 offset) override {
|
||||
for (auto &member : this->m_members) {
|
||||
member->setOffset(offset + (member->getOffset() - this->getOffset()));
|
||||
if (!this->isLocal()) {
|
||||
for (auto &member: this->m_members) {
|
||||
member->setOffset(offset + (member->getOffset() - this->getOffset()));
|
||||
}
|
||||
}
|
||||
|
||||
PatternData::setOffset(offset);
|
||||
|
|
|
@ -39,8 +39,8 @@ namespace hex::pl {
|
|||
}
|
||||
|
||||
pattern->setVariableName(name);
|
||||
pattern->setOffset(this->getStack().size());
|
||||
pattern->setLocal(true);
|
||||
pattern->setOffset(this->getStack().size());
|
||||
|
||||
this->getStack().emplace_back();
|
||||
variables.push_back(pattern);
|
||||
|
|
Loading…
Reference in New Issue