summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/src/llvm/llvm_gen_backend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 738f7d3..39620f6 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -879,6 +879,10 @@ namespace gbe
const uint64_t u64 = CI->getZExtValue();
return ctx.newImmediate(u64);
} else {
+ if (CI->getValue().getActiveBits() > 64) {
+ ctx.getUnit().setValid(false);
+ return ctx.newImmediate(uint64_t(0));
+ }
return ctx.newImmediate(uint64_t(CI->getZExtValue()));
}
}