Skip to content

Commit

Permalink
Error when compiling invalid AddrSpacePtrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jun 1, 2020
1 parent 7301dc6 commit 968ccfc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,16 +591,14 @@ static Type *bitstype_to_llvm(jl_value_t *bt, bool llvmcall = false)
if (bt == (jl_value_t*)jl_float64_type)
return T_float64;
if (jl_is_addrspace_ptr_type(bt)) {
int as = 0;

jl_datatype_t *typ = (jl_datatype_t*)bt;
jl_value_t *as_param = jl_svecref(typ->parameters, 1);

jl_value_t *as_param = jl_tparam1(bt);
int as;
if (jl_is_int32(as_param))
as = jl_unbox_int32(as_param);
else if (jl_is_int64(as_param))
as = jl_unbox_int64(as_param);

else
jl_error("invalid pointer address space");
return PointerType::get(T_int8, as);
}
int nb = jl_datatype_size(bt);
Expand Down

0 comments on commit 968ccfc

Please sign in to comment.