@@ -786,8 +786,8 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
786786 fname = ops[2 ]
787787
788788 if isa (flib, LLVM. LoadInst)
789- op, _ = get_base_and_offset (operands (flib)[1 ]; offsetAllowed = false , inttoptr= true )
790-
789+ op, off = get_base_and_offset (operands (flib)[1 ]; inttoptr= true )
790+
791791 if isa (op, LLVM. LoadInst)
792792 pop, _ = get_base_and_offset (operands (op)[1 ]; offsetAllowed= false , inttoptr= true )
793793
@@ -796,7 +796,7 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
796796
797797 rep = zop
798798 PT = value_type (rep)
799- if isa (PT, LLVM. PointerType)
799+ if isa (PT, LLVM. PointerType)
800800 rep = LLVM. const_inttoptr (rep, LLVM. PointerType (eltype (PT)))
801801 rep = LLVM. const_addrspacecast (rep, PT)
802802 replace_uses! (pop, rep)
@@ -808,7 +808,10 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
808808 end
809809
810810 if isa (op, ConstantInt)
811- rep = reinterpret (Ptr{Cvoid}, convert (Csize_t, op) + 8 )
811+ @static if VERSION < v " 1.12"
812+ off += 8
813+ end
814+ rep = reinterpret (Ptr{Cvoid}, convert (Csize_t, op) + off)
812815 ld = unsafe_load (convert (Ptr{Ptr{Cvoid}}, rep))
813816 flib = Base. unsafe_pointer_to_objref (ld)
814817 end
@@ -830,8 +833,8 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
830833 fname = String (map (Base. Fix1 (convert, UInt8), collect (fname)[1 : (end - 1 )]))
831834 end
832835
833- if ! isa (fname, String) || ! isa (flib, String)
834- return
836+ if ! isa (fname, String) || ! isa (flib, String)
837+ return
835838 end
836839
837840 found, replaceWith = try_import_llvmbc (mod, flib, fname, imported)
@@ -882,7 +885,7 @@ function check_ir!(interp, @nospecialize(job::CompilerJob), errors::Vector{IRErr
882885 fname,
883886 )
884887 end
885- catch
888+ catch e
886889 nothing
887890 end
888891
0 commit comments