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

Unified Diff: src/IceFixups.h

Issue 1428443002: Enhance address mode recovery (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Streamline absolute addressing support (rip-relative on x64) Created 5 years, 2 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/IceFixups.h
diff --git a/src/IceFixups.h b/src/IceFixups.h
index 303e592bb3d35e582eadb5141139f481e10f8a8d..36c333719c4665e7bc09633392ee526609873d09 100644
--- a/src/IceFixups.h
+++ b/src/IceFixups.h
@@ -31,8 +31,14 @@ struct AssemblerFixup {
public:
AssemblerFixup() = default;
AssemblerFixup(const AssemblerFixup &) = default;
- intptr_t position() const { return position_; }
- void set_position(intptr_t Position) { position_ = Position; }
+ intptr_t position() const {
+ assert(position_was_set_);
+ return position_;
+ }
+ void set_position(intptr_t Position) {
+ position_ = Position;
+ position_was_set_ = true;
+ }
FixupKind kind() const { return kind_; }
void set_kind(FixupKind Kind) { kind_ = Kind; }
@@ -50,6 +56,7 @@ public:
bool IsPCRel) const;
private:
+ bool position_was_set_ = false;
intptr_t position_ = 0;
FixupKind kind_ = 0;
const Constant *value_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698