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

Unified Diff: src/IceOperand.h

Issue 1669443002: Subzero. Uses fixups to calculate addend to relocations. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 11 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
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index e2a572ac13eaddafa2d84f23232c8a22e62c984e..91e9de0f3be83633cf5638664f972907083f0576 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -265,6 +265,7 @@ public:
return new (Ctx->allocate<RelocOffset>()) RelocOffset(Value);
}
+ void setSubtract(bool Value) { Subtract = Value; }
bool hasOffset() const { return HasOffset; }
RelocOffsetT getOffset() const {
@@ -274,7 +275,12 @@ public:
void setOffset(const RelocOffsetT Value) {
assert(!HasOffset);
- Offset = Value;
+ if (Subtract) {
+ assert(Value != std::numeric_limits<RelocOffsetT>::lowest());
+ Offset = -Value;
+ } else {
+ Offset = Value;
+ }
HasOffset = true;
}
@@ -282,6 +288,7 @@ private:
RelocOffset() = default;
explicit RelocOffset(RelocOffsetT Offset) { setOffset(Offset); }
+ bool Subtract = false;
bool HasOffset = false;
RelocOffsetT Offset;
};

Powered by Google App Engine
This is Rietveld 408576698