[IRInterpreter] Fix misevaluation of interpretation expressions with `urem`.
Scalar::MakeUnsigned was implemented incorrectly so it didn't
really change the sign of the type (leaving signed types signed).
This showed up as a misevaluation when IR-interpreting urem but
it's likely to arise in other contexts.
This commit fixes the definition, and adds a test to make
sure this won't regress in future (hopefully).
Fixes rdar://problem/42038760 and LLVM PR38076
Differential Revision: https://reviews.llvm.org/D49155
llvm-svn: 336872
diff --git a/lldb/source/Core/Scalar.cpp b/lldb/source/Core/Scalar.cpp
index 72108c4..6a71869 100644
--- a/lldb/source/Core/Scalar.cpp
+++ b/lldb/source/Core/Scalar.cpp
@@ -1184,38 +1184,38 @@
case e_void:
break;
case e_sint:
- success = true;
- break;
- case e_uint:
m_type = e_uint;
success = true;
break;
- case e_slong:
+ case e_uint:
success = true;
break;
- case e_ulong:
+ case e_slong:
m_type = e_ulong;
success = true;
break;
- case e_slonglong:
+ case e_ulong:
success = true;
break;
- case e_ulonglong:
+ case e_slonglong:
m_type = e_ulonglong;
success = true;
break;
- case e_sint128:
+ case e_ulonglong:
success = true;
break;
- case e_uint128:
+ case e_sint128:
m_type = e_uint128;
success = true;
break;
+ case e_uint128:
+ success = true;
+ break;
case e_sint256:
+ m_type = e_uint256;
success = true;
break;
case e_uint256:
- m_type = e_uint256;
success = true;
break;
case e_float: