diff options
| author | John Hodge <tpg@ucc.asn.au> | 2019-08-08 22:42:31 +0800 |
|---|---|---|
| committer | John Hodge <tpg@ucc.asn.au> | 2019-08-08 22:42:31 +0800 |
| commit | dd5c8ea810f8fb95fae71ae16d45dbff945651b7 (patch) | |
| tree | aec06d914dc5f7264dd1f490d4c7bc9ace0974b8 /tools/standalone_miri/value.cpp | |
| parent | c1fe76bfbe373207c531519a9345cafb4166c667 (diff) | |
| download | mrust-dd5c8ea810f8fb95fae71ae16d45dbff945651b7.tar.gz | |
Standalone MIRI - Downgrade an error based on observed patterns
Diffstat (limited to 'tools/standalone_miri/value.cpp')
| -rw-r--r-- | tools/standalone_miri/value.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/standalone_miri/value.cpp b/tools/standalone_miri/value.cpp index 7c3e205a..8860c8d9 100644 --- a/tools/standalone_miri/value.cpp +++ b/tools/standalone_miri/value.cpp @@ -25,7 +25,7 @@ namespace { ::std::ostream& operator<<(::std::ostream& os, const Allocation* x) { - os << "A(" << static_cast<const void*>(x) << " " << x->tag() /*<< " +" << x->size()*/ << ")"; + os << "A(#" << x->m_index << " " << x->tag() /*<< " +" << x->size()*/ << ")"; return os; } @@ -61,9 +61,12 @@ bool FfiLayout::is_valid_read(size_t o, size_t s) const return true; } +uint64_t Allocation::s_next_index = 0; + AllocationHandle Allocation::new_alloc(size_t size, ::std::string tag) { Allocation* rv = new Allocation(); + rv->m_index = s_next_index++; rv->m_tag = ::std::move(tag); rv->refcount = 1; rv->m_size = size; @@ -530,7 +533,7 @@ void Allocation::write_bytes(size_t ofs, const void* src, size_t count) if(count == 0) return ; - TRACE_FUNCTION_R("Allocation::write_bytes " << this << " " << ofs << "+" << count, *this); + //TRACE_FUNCTION_R("Allocation::write_bytes " << this << " " << ofs << "+" << count, *this); if( !in_bounds(ofs, count, this->size()) ) { LOG_ERROR("Out of bounds write, " << ofs << "+" << count << " > " << this->size()); throw "ERROR"; |
