From 1b19f39382e4bc6f8d2aa544d69f65f9fff34eb1 Mon Sep 17 00:00:00 2001 From: William Moses Date: Tue, 31 Dec 2024 14:48:02 -0500 Subject: [PATCH] Update validation.jl (#2243) --- src/compiler/validation.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)