@@ -1599,22 +1599,28 @@ static Value *emit_known_call(jl_value_t *ff, jl_value_t **args, size_t nargs,
1599
1599
else if (f->fptr == &jl_f_isa && nargs==2 ) {
1600
1600
jl_value_t *arg = expr_type (args[1 ], ctx); rt1 = arg;
1601
1601
jl_value_t *ty = expr_type (args[2 ], ctx); rt2 = ty;
1602
- if (jl_is_type_type (ty) && !jl_is_typevar (jl_tparam0 (ty))) {
1602
+ if (arg == jl_bottom_type) {
1603
+ JL_GC_POP ();
1604
+ emit_expr (args[1 ], ctx);
1605
+ return UndefValue::get (T_int1);
1606
+ }
1607
+ if (jl_is_type_type (ty) && !jl_has_typevars (jl_tparam0 (ty))) {
1603
1608
jl_value_t *tp0 = jl_tparam0 (ty);
1604
- if (arg != jl_bottom_type && jl_subtype (arg, tp0, 0 )) {
1609
+ if (jl_subtype (arg, tp0, 0 )) {
1605
1610
JL_GC_POP ();
1606
1611
return ConstantInt::get (T_int1,1 );
1607
1612
}
1608
- if (!jl_is_tuple (tp0) && jl_is_leaf_type (tp0) &&
1609
- !jl_is_type_type (tp0)) {
1613
+ if (!jl_is_tuple (tp0) && !jl_is_type_type (tp0)) {
1610
1614
if (jl_is_leaf_type (arg)) {
1611
1615
JL_GC_POP ();
1612
1616
return ConstantInt::get (T_int1,0 );
1613
1617
}
1614
- Value *arg1 = emit_expr (args[1 ], ctx);
1615
- JL_GC_POP ();
1616
- return builder.CreateICmpEQ (emit_typeof (arg1),
1617
- literal_pointer_val (tp0));
1618
+ if (jl_is_leaf_type (tp0)) {
1619
+ Value *arg1 = emit_expr (args[1 ], ctx);
1620
+ JL_GC_POP ();
1621
+ return builder.CreateICmpEQ (emit_typeof (arg1),
1622
+ literal_pointer_val (tp0));
1623
+ }
1618
1624
}
1619
1625
}
1620
1626
}
0 commit comments