Skip to content

Commit e87123a

Browse files
authored
Fixes required for targeting wasm32 (#199)
1 parent 64112d5 commit e87123a

File tree

3 files changed

+327
-106
lines changed

3 files changed

+327
-106
lines changed

lldb-eval/eval.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "lldb/API/SBType.h"
2525
#include "lldb/API/SBValue.h"
2626
#include "lldb/lldb-enumerations.h"
27+
#include "llvm/ADT/APSInt.h"
2728
#include "llvm/Support/FormatVariadic.h"
2829

2930
namespace lldb_eval {
@@ -981,7 +982,11 @@ Value Interpreter::EvaluateComparison(BinaryOpKind kind, Value lhs, Value rhs) {
981982
}
982983

983984
// Must be pointer/integer and/or nullptr comparison.
984-
bool ret = Compare(kind, lhs.GetUInt64(), rhs.GetUInt64());
985+
size_t ptr_size = target_.GetAddressByteSize() * 8;
986+
987+
bool ret =
988+
Compare(kind, llvm::APSInt(lhs.GetInteger().sextOrTrunc(ptr_size), true),
989+
llvm::APSInt(rhs.GetInteger().sextOrTrunc(ptr_size), true));
985990
return CreateValueFromBool(target_, ret);
986991
}
987992

0 commit comments

Comments
 (0)