summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-05-13 09:54:54 +0800
committerJohn Hodge <tpg@mutabah.net>2018-05-13 09:54:54 +0800
commitd3334162fa91fe6fd5d02912d9f82794306e646a (patch)
tree10e3005a065ca9e368a912493cc5d5fb8e94e57e /tools
parentac6f3ffba823e539c4c9afd93b7edf7122f463cc (diff)
downloadmrust-d3334162fa91fe6fd5d02912d9f82794306e646a.tar.gz
Standalone MIRI - Create allocations for static data
Diffstat (limited to 'tools')
-rw-r--r--tools/standalone_miri/module_tree.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/standalone_miri/module_tree.cpp b/tools/standalone_miri/module_tree.cpp
index fdc8f587..c70f17dd 100644
--- a/tools/standalone_miri/module_tree.cpp
+++ b/tools/standalone_miri/module_tree.cpp
@@ -146,8 +146,11 @@ bool Parser::parse_one()
if( lex.next() == TokenClass::String )
{
auto reloc_str = ::std::move(lex.consume().strval);
- // TODO: Figure out how to create this allocation...
- //s.val.allocation.alloc().relocations.push_back({ ofs, AllocationPtr::new_string(reloc_str) });
+
+ auto a = Allocation::new_alloc( reloc_str.size() );
+ //a.alloc().set_tag();
+ a.alloc().write_bytes(0, reloc_str.data(), reloc_str.size());
+ s.val.allocation.alloc().relocations.push_back({ ofs, ::std::move(a) });
}
else if( lex.next() == "::" || lex.next() == "<" )
{