]> git.lizzy.rs Git - rust.git/commitdiff
Extend Termination::report return value as necessary
authorbjorn3 <bjorn3@users.noreply.github.com>
Sun, 18 Apr 2021 08:58:42 +0000 (10:58 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Sun, 18 Apr 2021 08:58:42 +0000 (10:58 +0200)
src/main_shim.rs

index 3305ca6f6eb9de9fcfe3fd80274279fe5e39d3db..713cf4ebdc00f66051c42b0d5d07c799326344ee 100644 (file)
@@ -113,7 +113,12 @@ fn create_entry_fn(
                 // 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(