summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/value.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-03-04 16:31:12 +0800
committerJohn Hodge <tpg@mutabah.net>2018-03-17 18:52:16 +0800
commit30659582e602d3b95fdf3ab390c49c67292ea48f (patch)
tree01d52ab53619849e19783e29be69637ccfdd3385 /tools/standalone_miri/value.hpp
parentee0735ef758078a54fef385677f950525af35a4e (diff)
downloadmrust-30659582e602d3b95fdf3ab390c49c67292ea48f.tar.gz
Standalone MIRI - Fiddling around
Diffstat (limited to 'tools/standalone_miri/value.hpp')
-rw-r--r--tools/standalone_miri/value.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/standalone_miri/value.hpp b/tools/standalone_miri/value.hpp
index baa47e3f..03689215 100644
--- a/tools/standalone_miri/value.hpp
+++ b/tools/standalone_miri/value.hpp
@@ -119,6 +119,8 @@ public:
return AllocationPtr();
}
+ void resize(size_t new_size);
+
void check_bytes_valid(size_t ofs, size_t size) const;
void mark_bytes_valid(size_t ofs, size_t size);
@@ -223,10 +225,15 @@ struct ValueRef
ValueRef(AllocationPtr ptr, size_t ofs, size_t size):
m_alloc(ptr),
+ m_value(nullptr),
m_offset(ofs),
m_size(size)
{
}
+ ValueRef(Value& val):
+ ValueRef(val, 0, val.size())
+ {
+ }
ValueRef(Value& val, size_t ofs, size_t size):
m_value(&val),
m_offset(ofs),
@@ -273,3 +280,4 @@ struct ValueRef
uint64_t read_usize(size_t ofs) const;
int64_t read_isize(size_t ofs) const { return static_cast<int64_t>(read_usize(ofs)); }
};
+extern ::std::ostream& operator<<(::std::ostream& os, const ValueRef& v);