From d2305796a548c64ce3a46408d1fcfaf1ba564c9c Mon Sep 17 00:00:00 2001 From: maartenvd Date: Fri, 12 Jul 2024 12:40:40 +0200 Subject: [PATCH] Update src/reflection/reflection.jl Co-authored-by: Paul Berg --- src/reflection/reflection.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflection/reflection.jl b/src/reflection/reflection.jl index 31f4dec..5851bc2 100644 --- a/src/reflection/reflection.jl +++ b/src/reflection/reflection.jl @@ -91,7 +91,7 @@ function invoke_tweaks!(ci::CodeInfo) prewalk(x) do x if x isa SlotNumber SlotNumber(x.id == 1 ? 2 : x.id+2) - elseif x isa Core.ReturnNode && x.val isa SlotNumber + elseif x isa Core.ReturnNode && isdefined(x, :val) && x.val isa SlotNumber Core.ReturnNode(SlotNumber(x.val.id == 1 ? 2 : x.val.id+2)) else x