From 67044ba29f8ef4b603303b3859fa7e088bd318c4 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 6 Jul 2021 12:59:20 -0400 Subject: [PATCH] fix #41157, unnecessary assertion on `Tuple{Union{}}` --- src/intrinsics.cpp | 1 - test/compiler/codegen.jl | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/intrinsics.cpp b/src/intrinsics.cpp index 7d0e94fd30783..e37ee264398e9 100644 --- a/src/intrinsics.cpp +++ b/src/intrinsics.cpp @@ -284,7 +284,6 @@ static Value *emit_unboxed_coercion(jl_codectx_t &ctx, Type *to, Value *unboxed) Type *ty = unboxed->getType(); if (ty == to) return unboxed; - assert(to->isIntOrPtrTy() || to->isFloatingPointTy()); bool frompointer = ty->isPointerTy(); bool topointer = to->isPointerTy(); const DataLayout &DL = jl_data_layout; diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index df29a339d5a85..f232b246a9fc9 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -593,3 +593,7 @@ f41438(y) = y[].x @test B41438.body.layout === C_NULL @test f41438(Ref{A41438}(A41438(C_NULL))) === C_NULL @test f41438(Ref{B41438}(B41438(C_NULL))) === C_NULL + +# issue #41157 +f41157(a, b) = a[1] = b[1] +@test_throws BoundsError f41157(Tuple{Int}[], Tuple{Union{}}[])