Skip to content

Commit 1c83cf2

Browse files
authored
Merge pull request #8312 from roc-lang/fix-check-optimized
fix roc check ReleaseFast
2 parents 54d2942 + ef22101 commit 1c83cf2

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

src/eval/StackValue.zig

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -761,30 +761,26 @@ pub fn decref(self: StackValue, layout_cache: *LayoutStore, ops: *RocOps) void {
761761
const alignment_u32: u32 = @intCast(elem_layout.alignment(layout_cache.targetUsize()).toByteUnits());
762762
const element_width: usize = @intCast(layout_cache.layoutSize(elem_layout));
763763
const elements_refcounted = elem_layout.isRefcounted();
764-
if (elements_refcounted) {
765-
if (list_value.isUnique()) {
766-
if (list_value.getAllocationDataPtr()) |source| {
767-
const count: usize = if (list_value.isSeamlessSlice()) blk: {
768-
const ptr = @as([*]usize, @ptrCast(@alignCast(source))) - 2;
769-
break :blk ptr[0];
770-
} else list_value.len();
771-
772-
var idx: usize = 0;
773-
while (idx < count) : (idx += 1) {
774-
const elem_ptr = source + idx * element_width;
775-
const elem_value = StackValue{
776-
.layout = elem_layout,
777-
.ptr = @ptrCast(elem_ptr),
778-
.is_initialized = true,
779-
};
780-
elem_value.decref(layout_cache, ops);
781-
}
764+
if (elements_refcounted and list_value.isUnique()) {
765+
if (list_value.getAllocationDataPtr()) |source| {
766+
const count: usize = if (list_value.isSeamlessSlice()) blk: {
767+
const ptr = @as([*]usize, @ptrCast(@alignCast(source))) - 2;
768+
break :blk ptr[0];
769+
} else list_value.len();
770+
771+
var idx: usize = 0;
772+
while (idx < count) : (idx += 1) {
773+
const elem_ptr = source + idx * element_width;
774+
const elem_value = StackValue{
775+
.layout = elem_layout,
776+
.ptr = @ptrCast(elem_ptr),
777+
.is_initialized = true,
778+
};
779+
elem_value.decref(layout_cache, ops);
782780
}
783781
}
784-
list_value.decref(alignment_u32, element_width, false, noopDecref, ops);
785-
return;
786782
}
787-
list_value.decref(alignment_u32, element_width, false, noopDecref, ops);
783+
list_value.decref(alignment_u32, element_width, elements_refcounted, noopDecref, ops);
788784
return;
789785
},
790786
.list_of_zst => {

0 commit comments

Comments
 (0)