================
@@ -1534,8 +1534,11 @@ llvm::Expected<Value> DWARFExpression::Evaluate(
 
     case DW_OP_plus_uconst: {
       const uint64_t uconst_value = op->getRawOperand(0);
+      const int byte_size = stack.back().GetScalar().GetByteSize();
       // Implicit conversion from a UINT to a Scalar...
       stack.back().GetScalar() += uconst_value;
+      if (byte_size > 0 && byte_size < 8)
+        stack.back().GetScalar().TruncOrExtendTo(byte_size * 8, false);
----------------
firmiana402 wrote:

This does not preserve the operand's type as required by `DW_OP_plus_uconst`: 
passing `false` changes every narrow signed operand to unsigned, and a signed 
64-bit operand is also promoted to unsigned by `operator+=` but skips this 
truncation entirely. That affects later signed operations and typed-operand 
checks.

https://github.com/llvm/llvm-project/pull/204896
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to