Skip to content

Commit

Permalink
fix #2850
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Apr 27, 2013
1 parent f06e259 commit c86b1cd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,17 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
}
if (fptr == &jl_value_ptr) {
assert(lrt->isPointerTy());
Value *ary = emit_expr(args[4], ctx);
jl_value_t *argi = args[4];
bool addressOf = false;
if (jl_is_expr(argi) && ((jl_expr_t*)argi)->head == amp_sym) {
addressOf = true;
argi = jl_exprarg(argi,0);
}
Value *ary = boxed(emit_expr(argi, ctx));
JL_GC_POP();
return mark_julia_type(builder.CreateBitCast(ary,lrt),rt);
return mark_julia_type(
builder.CreateBitCast(emit_nthptr_addr(ary, addressOf?1:0),lrt),
rt);
}

// make LLVM function object for the target
Expand Down

0 comments on commit c86b1cd

Please sign in to comment.