Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: src/IceTargetLoweringX8664.cpp

Issue 1852713004: Subzero: Fix a cleanup error after the IceString removal CL. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Makefile.standalone ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8664.cpp
diff --git a/src/IceTargetLoweringX8664.cpp b/src/IceTargetLoweringX8664.cpp
index 6ac908ca9c7c52bfff74fe0b5aee960fd3b1ce50..33606d4893a62e03e43779f12a6e365e2738436b 100644
--- a/src/IceTargetLoweringX8664.cpp
+++ b/src/IceTargetLoweringX8664.cpp
@@ -406,15 +406,15 @@ Traits::X86OperandMem *TargetX8664::_sandbox_mem_reference(X86OperandMem *Mem) {
}
}
- // NeedsLea is a flags indicating whether Mem needs to be materialized to a
- // GPR prior to being used. A LEA is needed if Mem.Offset is a constant
+ // NeedsLea is a flag indicating whether Mem needs to be materialized to a GPR
+ // prior to being used. A LEA is needed if Mem.Offset is a constant
// relocatable, or if Mem.Offset is negative. In both these cases, the LEA is
// needed to ensure the sandboxed memory operand will only use the lower
// 32-bits of T+Offset.
bool NeedsLea = false;
if (Offset != nullptr) {
- if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) {
- NeedsLea = CR->getOffset() < 0;
+ if (llvm::isa<ConstantRelocatable>(Offset)) {
+ NeedsLea = true;
} else if (const auto *Imm = llvm::dyn_cast<ConstantInteger32>(Offset)) {
NeedsLea = Imm->getValue() < 0;
} else {
« no previous file with comments | « Makefile.standalone ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698