summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/value.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-05-19 08:09:14 +0800
committerJohn Hodge <tpg@mutabah.net>2018-05-19 08:09:14 +0800
commitaada4f2fe9be2f9bfadb4ef6ba057f36b9860aa8 (patch)
treeb62d2e8f707518eec23a1cfe3fde239d16b15650 /tools/standalone_miri/value.cpp
parent1320ff65f1fcce3cbd492eaf6f300ac81e2f8ae3 (diff)
downloadmrust-aada4f2fe9be2f9bfadb4ef6ba057f36b9860aa8.tar.gz
Standalone MIRI - Pass argv to the target
Diffstat (limited to 'tools/standalone_miri/value.cpp')
-rw-r--r--tools/standalone_miri/value.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/standalone_miri/value.cpp b/tools/standalone_miri/value.cpp
index d8eeee01..e9376ce6 100644
--- a/tools/standalone_miri/value.cpp
+++ b/tools/standalone_miri/value.cpp
@@ -227,13 +227,16 @@ void* ValueCommonRead::read_pointer_unsafe(size_t rd_ofs, size_t req_valid, size
}
case RelocationPtr::Ty::Function:
LOG_FATAL("read_pointer w/ function");
- case RelocationPtr::Ty::FfiPointer:
- if( req_valid )
- LOG_FATAL("Can't request valid data from a FFI pointer");
+ case RelocationPtr::Ty::FfiPointer: {
+ const auto& f = reloc.ffi();
+ // TODO: Validity?
+ //if( req_valid )
+ // LOG_FATAL("Can't request valid data from a FFI pointer");
// TODO: Have an idea of mutability and available size from FFI
- out_size = 0;
+ out_size = f.size - ofs;
out_is_mut = false;
- return reloc.ffi().ptr_value /* + ofs */;
+ return reloc.ffi().ptr_value + ofs;
+ }
}
throw "";
}