Skip to content

Commit 1b19f39

Browse files
authored
Update validation.jl (#2243)
1 parent 883c777 commit 1b19f39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/validation.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ function check_ir!(@nospecialize(job::CompilerJob), errors::Vector{IRError}, imp
267267
end
268268
end
269269
@assert FT !== nothing
270-
271-
initfn, _ = get_base_and_offset(LLVM.initializer(fn_got); offsetAllowed=false, inttoptr=false)
270+
init = LLVM.initializer(fn_got)
271+
if init !== nothing
272+
initfn, _ = get_base_and_offset(init; offsetAllowed=false, inttoptr=false)
272273
loadfn = first(instructions(first(blocks(initfn))))::LLVM.LoadInst
273274
opv = operands(loadfn)[1]
274275
if !isa(opv, LLVM.GlobalVariable)
@@ -433,6 +434,7 @@ function check_ir!(@nospecialize(job::CompilerJob), errors::Vector{IRError}, imp
433434
LLVM.API.LLVMDeleteGlobal(fn_got)
434435
end
435436
end
437+
end
436438

437439
elseif isInline
438440
md = metadata(inst)

0 commit comments

Comments
 (0)