From f8b4b792c723470e9b6cb2f6ae5b842c9eb43cc1 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:50:06 +0900 Subject: [PATCH] inference: handle `LimitedAccuracy` in `handle_global_assignment!` (#54130) `abstract_eval_statement` may return `LimitedAccuracy` so we need to handle it before applying `widenconst`. - fixes #54125 --- base/compiler/abstractinterpretation.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index d76e64c84aaae..e4c436c94f72e 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -2845,7 +2845,7 @@ end function handle_global_assignment!(interp::AbstractInterpreter, frame::InferenceState, lhs::GlobalRef, @nospecialize(newty)) effect_free = ALWAYS_FALSE - nothrow = global_assignment_nothrow(lhs.mod, lhs.name, newty) + nothrow = global_assignment_nothrow(lhs.mod, lhs.name, ignorelimited(newty)) inaccessiblememonly = ALWAYS_FALSE if !nothrow sub_curr_ssaflag!(frame, IR_FLAG_NOTHROW) @@ -3050,7 +3050,6 @@ end return BasicStmtChange(nothing, rt, exct) end changes = nothing - stmt = stmt::Expr hd = stmt.head if hd === :(=) (; rt, exct) = abstract_eval_statement(interp, stmt.args[2], pc_vartable, frame)