Skip to content

Commit bf85572

Browse files
committed
Extend Termination::report return value as necessary
1 parent e01de0f commit bf85572

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main_shim.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ pub(crate) fn maybe_create_entry_wrapper(
113113
// FIXME do proper abi handling instead of expecting the pass mode to be identical
114114
// for returns and arguments.
115115
let report_call_inst = bcx.ins().call(report_func_ref, &call_results);
116-
bcx.func.dfg.inst_results(report_call_inst)[0]
116+
let res = bcx.func.dfg.inst_results(report_call_inst)[0];
117+
match m.target_config().pointer_type() {
118+
types::I32 => res,
119+
types::I64 => bcx.ins().sextend(types::I64, res),
120+
_ => unimplemented!("16bit systems are not yet supported"),
121+
}
117122
} else if is_main_fn {
118123
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
119124
let start_instance = Instance::resolve(

0 commit comments

Comments
 (0)