summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/value.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-08-04 15:08:30 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-08-04 15:08:30 +0800
commite14473dcce910959a3f6a3c0c683456ab0f9dd1a (patch)
tree9463451f3f755bee4bcd2e652c3b04a8daa88dc5 /tools/standalone_miri/value.hpp
parent982826e4b309979bee8fe10f6ff537b4922e6316 (diff)
downloadmrust-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.hpp3
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; }