Skip to content

Commit 4733c00

Browse files
authored
fix #41157, unnecessary assertion on Tuple{Union{}} (#41483)
1 parent c73901e commit 4733c00

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: src/intrinsics.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ static Value *emit_unboxed_coercion(jl_codectx_t &ctx, Type *to, Value *unboxed)
284284
Type *ty = unboxed->getType();
285285
if (ty == to)
286286
return unboxed;
287-
assert(to->isIntOrPtrTy() || to->isFloatingPointTy());
288287
bool frompointer = ty->isPointerTy();
289288
bool topointer = to->isPointerTy();
290289
const DataLayout &DL = jl_data_layout;

Diff for: test/compiler/codegen.jl

+4
Original file line numberDiff line numberDiff line change
@@ -593,3 +593,7 @@ f41438(y) = y[].x
593593
@test B41438.body.layout === C_NULL
594594
@test f41438(Ref{A41438}(A41438(C_NULL))) === C_NULL
595595
@test f41438(Ref{B41438}(B41438(C_NULL))) === C_NULL
596+
597+
# issue #41157
598+
f41157(a, b) = a[1] = b[1]
599+
@test_throws BoundsError f41157(Tuple{Int}[], Tuple{Union{}}[])

0 commit comments

Comments
 (0)