Skip to content

Commit

Permalink
Work around #29929
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored and staticfloat committed Dec 13, 2018
1 parent d0940a2 commit 26a421d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions base/compiler/ssair/verify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ end

function check_op(ir::IRCode, domtree::DomTree, @nospecialize(op), use_bb::Int, use_idx::Int)
if isa(op, SSAValue)
if op.id <= 0
@verify_error "SSA id is zero or negative"
error()
end
if op.id > length(ir.stmts)
def_bb = block_for_inst(ir.cfg, ir.new_nodes[op.id - length(ir.stmts)].pos)
else
Expand Down
4 changes: 2 additions & 2 deletions base/threadcall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ macro threadcall(f, rettype, argtypes, argvals...)
push!(args, arg)
end
push!(body, :(ret = ccall($f, $rettype, ($(argtypes...),), $(args...))))
push!(body, :(unsafe_store!(convert(Ptr{$rettype}, retval_ptr), ret)))
push!(body, :(sizeof($rettype) != 0 && unsafe_store!(convert(Ptr{$rettype}, retval_ptr), ret)))
push!(body, :(return Int(Core.sizeof($rettype))))

# return code to generate wrapper function and send work request thread queue
Expand Down Expand Up @@ -94,7 +94,7 @@ function do_threadcall(fun_ptr::Ptr{Cvoid}, rettype::Type, argtypes::Vector, arg
thread_notifiers[idx] = nothing
release(threadcall_restrictor)

r = unsafe_load(convert(Ptr{rettype}, pointer(ret_arr)))
r = sizeof(rettype) == 0 ? rettype.instance : unsafe_load(convert(Ptr{rettype}, pointer(ret_arr)))
end
return r
end

0 comments on commit 26a421d

Please sign in to comment.