From bf85572f59f5b70d73869c3902964c5ca47668df Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 18 Apr 2021 10:58:42 +0200 Subject: [PATCH] Extend Termination::report return value as necessary --- src/main_shim.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main_shim.rs b/src/main_shim.rs index 3305ca6f6eb..713cf4ebdc0 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -113,7 +113,12 @@ pub(crate) fn maybe_create_entry_wrapper( // FIXME do proper abi handling instead of expecting the pass mode to be identical // for returns and arguments. let report_call_inst = bcx.ins().call(report_func_ref, &call_results); - bcx.func.dfg.inst_results(report_call_inst)[0] + let res = bcx.func.dfg.inst_results(report_call_inst)[0]; + match m.target_config().pointer_type() { + types::I32 => res, + types::I64 => bcx.ins().sextend(types::I64, res), + _ => unimplemented!("16bit systems are not yet supported"), + } } else if is_main_fn { let start_def_id = tcx.require_lang_item(LangItem::Start, None); let start_instance = Instance::resolve(