Skip to content

Commit

Permalink
fix JuliaLang#2584, missing undefined reference check
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 16, 2013
1 parent afb7e82 commit 60acce4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,9 @@ static Value *emit_getfield(jl_value_t *expr, jl_sym_t *name, jl_codectx_t *ctx)
sty->fields[idx].offset + sizeof(void*)));
JL_GC_POP();
if (sty->fields[idx].isptr) {
return builder.CreateLoad(builder.CreateBitCast(addr,jl_ppvalue_llvmt));
Value *fldv = builder.CreateLoad(builder.CreateBitCast(addr,jl_ppvalue_llvmt));
null_pointer_check(fldv, ctx);
return fldv;
}
else {
return typed_load(addr, ConstantInt::get(T_size, 0), jfty, ctx);
Expand All @@ -858,6 +860,9 @@ static Value *emit_getfield(jl_value_t *expr, jl_sym_t *name, jl_codectx_t *ctx)
if (jfty == (jl_value_t*)jl_bool_type) {
fldv = builder.CreateTrunc(fldv, T_int1);
}
else if (sty->fields[idx].isptr) {
null_pointer_check(fldv, ctx);
}
JL_GC_POP();
return mark_julia_type(fldv, jfty);
}
Expand Down

0 comments on commit 60acce4

Please sign in to comment.