diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-08-04 15:08:30 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-08-04 15:08:30 +0800 |
commit | e14473dcce910959a3f6a3c0c683456ab0f9dd1a (patch) | |
tree | 9463451f3f755bee4bcd2e652c3b04a8daa88dc5 /tools/standalone_miri/value.hpp | |
parent | 982826e4b309979bee8fe10f6ff537b4922e6316 (diff) | |
download | mrust-e14473dcce910959a3f6a3c0c683456ab0f9dd1a.tar.gz |
Standalone MIRI - Restructure so `0` is never a valid pointer value
Diffstat (limited to 'tools/standalone_miri/value.hpp')
-rw-r--r-- | tools/standalone_miri/value.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/standalone_miri/value.hpp b/tools/standalone_miri/value.hpp index 19df8540..ec8f1899 100644 --- a/tools/standalone_miri/value.hpp +++ b/tools/standalone_miri/value.hpp @@ -255,6 +255,9 @@ public: virtual ~Allocation() {} static AllocationHandle new_alloc(size_t size, ::std::string tag); + // NOTE: This should match the value in the MMIR backend + static const size_t PTR_BASE = 0x1000; + const uint8_t* data_ptr() const { return reinterpret_cast<const uint8_t*>(this->data.data()); } uint8_t* data_ptr() { return reinterpret_cast< uint8_t*>(this->data.data()); } size_t size() const { return this->data.size() * 8; } |