1
0
mirror of synced 2025-01-29 19:17:28 +01:00

patterns: Fixed placed signed integers not being sign extended correctly

This commit is contained in:
WerWolv 2021-11-27 14:34:59 +01:00
parent 9158d79126
commit 9340c8aae3

View File

@ -1454,10 +1454,6 @@ namespace hex::pl {
std::visit(overloaded {
[&](std::string &assignmentValue) { },
[&](s128 assignmentValue) {
std::memcpy(&value, &assignmentValue, pattern->getSize());
value = hex::signExtend(pattern->getSize() * 8, value);
},
[&](auto &&assignmentValue) { std::memcpy(&value, &assignmentValue, pattern->getSize()); }
}, literal);
}
@ -1491,6 +1487,7 @@ namespace hex::pl {
} else if (dynamic_cast<PatternDataSigned*>(pattern)) {
s128 value = 0;
readValue(value, pattern);
value = hex::signExtend(pattern->getSize() * 8, value);
literal = value;
} else if (dynamic_cast<PatternDataFloat*>(pattern)) {
if (pattern->getSize() == sizeof(u16)) {