diff options
| author | John Hodge <tpg@mutabah.net> | 2018-05-13 09:55:13 +0800 |
|---|---|---|
| committer | John Hodge <tpg@mutabah.net> | 2018-05-13 09:55:13 +0800 |
| commit | c7b3036cefcd0dc412cb400455324d7ca8cd518e (patch) | |
| tree | c789dec0d4d22cfabd04c65b20d058ace470559b /tools/standalone_miri/value.cpp | |
| parent | d3334162fa91fe6fd5d02912d9f82794306e646a (diff) | |
| download | mrust-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.cpp | 3 |
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; |
