Skip to content

Commit 3227831

Browse files
committed
fixed failing tests
1 parent d66c10a commit 3227831

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

code/ndarray.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,11 @@ ndarray_obj_t *ndarray_new_view(ndarray_obj_t *source, uint8_t ndim, size_t *sha
726726
ndarray->array = pointer;
727727
#if ULAB_HAS_BLOCKS
728728
ndarray->flags = source->flags;
729-
ndarray->block = source->block;
730-
ndarray->block->ndarray = ndarray;
729+
if(source->flags) {
730+
// copy the block, only if ndarray has a block object
731+
ndarray->block = source->block;
732+
ndarray->block->ndarray = ndarray;
733+
}
731734
#endif
732735
return ndarray;
733736
}

0 commit comments

Comments
 (0)