From 9dbc852305fa2d68418509c13f3db8507c217600 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 3 Apr 2024 07:59:06 +0900 Subject: [PATCH] fix up the adjustments for v1.12 (#43) * fix up the adjustments for v1.12 * add `@static` annotation --- Project.toml | 2 +- src/CassetteOverlay.jl | 3 +-- test/runtests.jl | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 29a3083..c99b33a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CassetteOverlay" uuid = "d78b62d4-37fa-4a6f-acd8-2f19986eb9ee" authors = ["JuliaHub, Inc. and other contributors"] -version = "0.1.9" +version = "0.1.10" [deps] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/CassetteOverlay.jl b/src/CassetteOverlay.jl index e6f1520..9468b35 100644 --- a/src/CassetteOverlay.jl +++ b/src/CassetteOverlay.jl @@ -110,11 +110,10 @@ function overlay_transform!(src::CodeInfo, mi::MethodInstance, nargs::Int) ssaid += 1 end prepend!(code, precode) - if VERSION < v"1.12.0-DEV.173" + @static if VERSION < v"1.12.0-DEV.173" prepend!(src.codelocs, [0 for i = 1:ssaid]) else di = Core.Compiler.DebugInfoStream(mi, src.debuginfo, length(code)) - prepend!(di.codelocs, fill(Int32(0), 3ssaid)) src.debuginfo = Core.DebugInfo(di, length(code)) end prepend!(src.ssaflags, [0x00 for i = 1:ssaid]) diff --git a/test/runtests.jl b/test/runtests.jl index 17920e8..ae76b08 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,7 +4,7 @@ using Test @testset "simple" include("simple.jl") @testset "math" include("math.jl") @testset "misc" include("misc.jl") - if VERSION >= v"1.10.0-DEV.90" + @static if VERSION >= v"1.10.0-DEV.90" # This interface depends on julia#47749 @testset "abstract" include("abstract.jl") end