Skip to content

Commit

Permalink
fix recent mistake in type checking for new()
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 14, 2014
1 parent 28bf877 commit 6ed2dc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ static void emit_typecheck(Value *x, jl_value_t *type, const std::string &msg,
jl_codectx_t *ctx)
{
Value *istype;
if (jl_is_tuple(type) && type != (jl_value_t*)jl_tuple_type) {
if ((jl_is_tuple(type) && type != (jl_value_t*)jl_tuple_type) ||
!jl_is_leaf_type(type)) {
istype = builder.
CreateICmpNE(builder.CreateCall3(jlsubtype_func, x, literal_pointer_val(type),
ConstantInt::get(T_int32,1)),
Expand Down

0 comments on commit 6ed2dc1

Please sign in to comment.