@@ -2188,14 +2188,13 @@ function abstract_eval_value_expr(interp::AbstractInterpreter, e::Expr, vtypes::
21882188 end
21892189 elseif head === :boundscheck
21902190 if isa (sv, InferenceState)
2191- flag = sv. src. ssaflags[sv. currpc]
2192- # If there is no particular @inbounds for this function, then we only taint `noinbounds`,
2193- # which will subsequently taint consistency if this function is called from another
2194- # function that uses `@inbounds`. However, if this :boundscheck is itself within an
2191+ # If there is no particular `@inbounds` for this function, then we only taint `:noinbounds`,
2192+ # which will subsequently taint `:consistent`-cy if this function is called from another
2193+ # function that uses `@inbounds`. However, if this `:boundscheck` is itself within an
21952194 # `@inbounds` region, its value depends on `--check-bounds`, so we need to taint
2196- # consistency here also.
2195+ # `:consistent`-cy here also.
21972196 merge_effects! (interp, sv, Effects (EFFECTS_TOTAL; noinbounds= false ,
2198- consistent = (flag & IR_FLAG_INBOUNDS) != 0 ? ALWAYS_FALSE : ALWAYS_TRUE))
2197+ consistent = (get_curr_flag (sv) & IR_FLAG_INBOUNDS) != 0 ? ALWAYS_FALSE : ALWAYS_TRUE))
21992198 end
22002199 rt = Bool
22012200 elseif head === :inbounds
@@ -2512,8 +2511,8 @@ function abstract_eval_phi(interp::AbstractInterpreter, phi::PhiNode, vtypes::Un
25122511end
25132512
25142513function stmt_taints_inbounds_consistency (sv:: InferenceState )
2515- flag = sv. src. ssaflags[sv . currpc]
2516- return sv . src . propagate_inbounds || (flag & IR_FLAG_INBOUNDS) != 0
2514+ sv. src. propagate_inbounds && return true
2515+ return ( get_curr_flag (sv) & IR_FLAG_INBOUNDS) != 0
25172516end
25182517
25192518function abstract_eval_statement (interp:: AbstractInterpreter , @nospecialize (e), vtypes:: VarTable , sv:: InferenceState )
@@ -2525,13 +2524,12 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
25252524 end
25262525 (;rt, effects) = abstract_eval_statement_expr (interp, e, vtypes, sv, nothing )
25272526 if ! effects. noinbounds
2528- flag = sv. src. ssaflags[sv. currpc]
25292527 if ! sv. src. propagate_inbounds
25302528 # The callee read our inbounds flag, but unless we propagate inbounds,
25312529 # we ourselves don't read our parent's inbounds.
25322530 effects = Effects (effects; noinbounds= true )
25332531 end
2534- if (flag & IR_FLAG_INBOUNDS) != 0
2532+ if (get_curr_flag (sv) & IR_FLAG_INBOUNDS) != 0
25352533 effects = Effects (effects; consistent= ALWAYS_FALSE)
25362534 end
25372535 end
0 commit comments