pass return layout along to checked add

This commit is contained in:
Folkert 2022-08-25 19:35:47 +02:00
parent 592a219f5d
commit 42d26a20b6
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
2 changed files with 4 additions and 4 deletions

View File

@ -769,13 +769,12 @@ impl<
src1: &Symbol,
src2: &Symbol,
num_layout: &Layout<'a>,
return_layout: &Layout<'a>,
) {
use Builtin::Int;
let buf = &mut self.buf;
let fields = [*num_layout, Layout::bool()];
let return_layout = Layout::struct_no_name_order(&fields);
let struct_size = return_layout.stack_size(self.target_info);
let base_offset = self.storage_manager.claim_stack_area(dst, struct_size);

View File

@ -406,7 +406,7 @@ trait Backend<'a> {
self.build_num_add(sym, &args[0], &args[1], ret_layout)
}
LowLevel::NumAddChecked => {
self.build_num_add_checked(sym, &args[0], &args[1], &arg_layouts[0])
self.build_num_add_checked(sym, &args[0], &args[1], &arg_layouts[0], ret_layout)
}
LowLevel::NumAcos => self.build_fn_call(
sym,
@ -715,7 +715,8 @@ trait Backend<'a> {
dst: &Symbol,
src1: &Symbol,
src2: &Symbol,
layout: &Layout<'a>,
num_layout: &Layout<'a>,
return_layout: &Layout<'a>,
);
/// build_num_mul stores `src1 * src2` into dst.