From 137f241fc6b16190a5964906380b8b05e76c0af1 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 18 Oct 2011 13:40:41 -0400 Subject: [PATCH] fixing bug in locals with strange Ptr{} types. affects copy_to(). closes issue #233 --- src/codegen.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index d5b32ffa708d1..91e6efc3b4886 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1452,12 +1452,11 @@ static bool store_unboxed_p(char *name, jl_codectx_t *ctx) static AllocaInst *alloc_local(char *name, jl_codectx_t *ctx) { jl_value_t *jt = (*ctx->declTypes)[name]; - const Type *vtype; + const Type *vtype=NULL; if (store_unboxed_p(name, ctx)) vtype = julia_type_to_llvm(jt, ctx); - else + if (vtype == NULL) vtype = jl_pvalue_llvmt; - assert(vtype != NULL); AllocaInst *lv = builder.CreateAlloca(vtype, 0, name); if (vtype != jl_pvalue_llvmt) mark_julia_type(lv, jt);