Skip to content

Commit

Permalink
[LLVM/ABI] Don't pass null pointer to byVal attribute (#44555)
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy authored Mar 11, 2022
1 parent e90dec9 commit f5d1557
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/abi_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, LLVMContext &ctx, Type *T
else if (jl_is_structtype(dt)) {
// spill to memory even though we would ordinarily pass
// it in registers
Type* Ty = preferred_llvm_type(dt, false, ctx);
ab.addByValAttr(Ty);
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@ std::string generate_func_sig(const char *fname)
}

// Whether or not LLVM wants us to emit a pointer to the data
assert(t && "LLVM type should not be null");
bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab, LLVMCtx, t);

if (jl_is_cpointer_type(tti)) {
Expand Down

0 comments on commit f5d1557

Please sign in to comment.