summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/standalone_miri/main.cpp14
-rw-r--r--tools/standalone_miri/module_tree.cpp3
2 files changed, 11 insertions, 6 deletions
diff --git a/tools/standalone_miri/main.cpp b/tools/standalone_miri/main.cpp
index c9cc7f38..b7f62252 100644
--- a/tools/standalone_miri/main.cpp
+++ b/tools/standalone_miri/main.cpp
@@ -378,6 +378,8 @@ Value MIRI_Invoke(ModuleTree& modtree, ::HIR::Path path, ::std::vector<Value> ar
return ret;
}
+ // TODO: Recursion limit.
+
TRACE_FUNCTION_R(path, path << " = " << ret);
for(size_t i = 0; i < args.size(); i ++)
{
@@ -809,11 +811,13 @@ Value MIRI_Invoke(ModuleTree& modtree, ::HIR::Path path, ::std::vector<Value> ar
switch(re.type.inner_type)
{
case RawType::Unreachable: throw "BUG";
- case RawType::Composite: throw "ERROR";
- case RawType::TraitObject: throw "ERROR";
- case RawType::Function: throw "ERROR";
- case RawType::Str: throw "ERROR";
- case RawType::Unit: throw "ERROR";
+ case RawType::Composite:
+ case RawType::TraitObject:
+ case RawType::Function:
+ case RawType::Str:
+ case RawType::Unit:
+ LOG_ERROR("Casting to " << re.type << " is invalid");
+ throw "ERROR";
case RawType::F32: {
float dst_val = 0.0;
// Can be an integer, or F64 (pointer is impossible atm)
diff --git a/tools/standalone_miri/module_tree.cpp b/tools/standalone_miri/module_tree.cpp
index f6b681cf..a75cfa8f 100644
--- a/tools/standalone_miri/module_tree.cpp
+++ b/tools/standalone_miri/module_tree.cpp
@@ -147,13 +147,14 @@ bool Parser::parse_one()
// TODO: Figure out how to create this allocation...
//s.val.allocation.alloc().relocations.push_back({ ofs, AllocationPtr::new_string(reloc_str) });
}
- else if( lex.next() == "::" )
+ else if( lex.next() == "::" || lex.next() == "<" )
{
auto reloc_path = parse_path();
s.val.allocation.alloc().relocations.push_back({ ofs, AllocationPtr::new_fcn(reloc_path) });
}
else
{
+ LOG_FATAL(lex << "Unexepcted token " << lex.next() << " in relocation value");
throw "ERROR";
}
if( ! lex.consume_if(',') ) {