diff --git a/src/compiler/validation.jl b/src/compiler/validation.jl index 9cab39dc29..aa078e9d62 100644 --- a/src/compiler/validation.jl +++ b/src/compiler/validation.jl @@ -267,8 +267,9 @@ function check_ir!(@nospecialize(job::CompilerJob), errors::Vector{IRError}, imp end end @assert FT !== nothing - - initfn, _ = get_base_and_offset(LLVM.initializer(fn_got); offsetAllowed=false, inttoptr=false) + init = LLVM.initializer(fn_got) + if init !== nothing + initfn, _ = get_base_and_offset(init; offsetAllowed=false, inttoptr=false) loadfn = first(instructions(first(blocks(initfn))))::LLVM.LoadInst opv = operands(loadfn)[1] if !isa(opv, LLVM.GlobalVariable) @@ -433,6 +434,7 @@ function check_ir!(@nospecialize(job::CompilerJob), errors::Vector{IRError}, imp LLVM.API.LLVMDeleteGlobal(fn_got) end end + end elseif isInline md = metadata(inst)