diff --git a/src/codegen.cpp b/src/codegen.cpp index 66b7d73a6228c..1e08cfce6b336 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2620,6 +2620,8 @@ static Value *emit_f_is(const jl_cgval_t &arg1, const jl_cgval_t &arg2, jl_codec if ((jl_is_type_type(rt1) && jl_is_leaf_type(jl_tparam0(rt1))) || (jl_is_type_type(rt2) && jl_is_leaf_type(jl_tparam0(rt2)))) // can compare leaf types by pointer ptr_comparable = 1; + if (rt1 == (jl_value_t*)jl_simplevector_type && rt2 == (jl_value_t*)jl_simplevector_type) + ptr_comparable = 0; // technically mutable, but compared by contents if (ptr_comparable) { Value *varg1 = arg1.constant ? literal_pointer_val(arg1.constant) : arg1.V; Value *varg2 = arg2.constant ? literal_pointer_val(arg2.constant) : arg2.V; diff --git a/test/codegen.jl b/test/codegen.jl new file mode 100644 index 0000000000000..45e8e157e43e9 --- /dev/null +++ b/test/codegen.jl @@ -0,0 +1,9 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +function egal_svecs() + a = Core.svec(:a, :b) + b = Core.svec(:a, :b) + a === b +end +@test egal_svecs() +@test Core.svec(:a, :b) === Core.svec(:a, :b)