mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
fix wrong alignment used to (re)allocate a list
This commit is contained in:
parent
5d6523f994
commit
edefbe5b6b
3 changed files with 21 additions and 2 deletions
|
@ -2975,7 +2975,7 @@ impl<
|
|||
let list_b_layout = arg_layouts[1];
|
||||
|
||||
// Load list alignment argument (u32).
|
||||
self.load_layout_alignment(*ret_layout, Symbol::DEV_TMP);
|
||||
self.load_layout_alignment(elem_layout, Symbol::DEV_TMP);
|
||||
|
||||
// Load element_width argument (usize).
|
||||
self.load_layout_stack_size(elem_layout, Symbol::DEV_TMP2);
|
||||
|
|
|
@ -95,6 +95,22 @@ fn dec_list_literal() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn dec_list_join() {
|
||||
assert_evals_to!(
|
||||
"List.concat [1.0dec, 2.0] [3.0, 4.0, 5.0]",
|
||||
RocList::from_slice(&[
|
||||
RocDec::from(1),
|
||||
RocDec::from(2),
|
||||
RocDec::from(3),
|
||||
RocDec::from(4),
|
||||
RocDec::from(5),
|
||||
]),
|
||||
RocList<RocDec>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn bool_list_concat() {
|
||||
|
|
|
@ -455,7 +455,7 @@ where
|
|||
T: PartialEq<U>,
|
||||
{
|
||||
fn eq(&self, other: &RocList<U>) -> bool {
|
||||
self.deref() == other.deref()
|
||||
self.as_slice() == other.as_slice()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,5 +812,8 @@ mod tests {
|
|||
let b = a.clone();
|
||||
|
||||
assert_eq!(a, b);
|
||||
|
||||
drop(a);
|
||||
drop(b);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue