diff --git a/plugins/libimhex/source/lang/evaluator.cpp b/plugins/libimhex/source/lang/evaluator.cpp index e1c1bfc56..4b7c08e7b 100644 --- a/plugins/libimhex/source/lang/evaluator.cpp +++ b/plugins/libimhex/source/lang/evaluator.cpp @@ -92,10 +92,10 @@ namespace hex::lang { default: this->getConsole().abortEvaluation("invalid rvalue size"); } } else if (auto signedPattern = dynamic_cast(currPattern); signedPattern != nullptr) { - u8 value[unsignedPattern->getSize()]; + u8 value[signedPattern->getSize()]; this->m_provider->read(signedPattern->getOffset(), value, signedPattern->getSize()); - switch (unsignedPattern->getSize()) { + switch (signedPattern->getSize()) { case 1: return new ASTNodeIntegerLiteral({ Token::ValueType::Signed8Bit, hex::changeEndianess(*reinterpret_cast(value), 1, signedPattern->getEndian()) }); case 2: return new ASTNodeIntegerLiteral({ Token::ValueType::Signed16Bit, hex::changeEndianess(*reinterpret_cast(value), 2, signedPattern->getEndian()) }); case 4: return new ASTNodeIntegerLiteral({ Token::ValueType::Signed32Bit, hex::changeEndianess(*reinterpret_cast(value), 4, signedPattern->getEndian()) });