From aada4f2fe9be2f9bfadb4ef6ba057f36b9860aa8 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 19 May 2018 08:09:14 +0800 Subject: Standalone MIRI - Pass argv to the target --- tools/standalone_miri/value.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tools/standalone_miri/value.cpp') 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 ""; } -- cgit v1.2.3