summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/value.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-05-13 09:55:13 +0800
committerJohn Hodge <tpg@mutabah.net>2018-05-13 09:55:13 +0800
commitc7b3036cefcd0dc412cb400455324d7ca8cd518e (patch)
treec789dec0d4d22cfabd04c65b20d058ace470559b /tools/standalone_miri/value.cpp
parentd3334162fa91fe6fd5d02912d9f82794306e646a (diff)
downloadmrust-c7b3036cefcd0dc412cb400455324d7ca8cd518e.tar.gz
Standalone MIRI - memrchr and better null checking
Diffstat (limited to 'tools/standalone_miri/value.cpp')
-rw-r--r--tools/standalone_miri/value.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/standalone_miri/value.cpp b/tools/standalone_miri/value.cpp
index 468425e9..db352019 100644
--- a/tools/standalone_miri/value.cpp
+++ b/tools/standalone_miri/value.cpp
@@ -169,6 +169,9 @@ void* ValueCommon::read_pointer_unsafe(size_t rd_ofs, size_t req_valid, size_t&
if( ofs != 0 ) {
LOG_FATAL("Read a non-zero offset with no relocation");
}
+ if( req_valid > 0 ) {
+ LOG_ERROR("Attempting to read a null pointer");
+ }
out_is_mut = false;
out_size = 0;
return nullptr;