Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Nov 20, 2023
1 parent 0f4a484 commit 98072a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/abstractinterpret/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,9 @@ function CC.abstract_eval_special_value(analyzer::AbstractAnalyzer, @nospecializ
# in this call graph, but it's highly possible this is a toplevel callsite
# and we take a risk here since we can't enter the analysis otherwise
val = getglobal(mod, name)
@static if VERSION v"1.11.0-DEV.797"
@static if VERSION v"1.11.0-DEV.945"
ret = CC.RTEffects(isa(val, AbstractGlobal) ? val.t : Const(val), ret.exct, ret.effects)
elseif VERSION v"1.11.0-DEV.797"
ret = CC.RTEffects(isa(val, AbstractGlobal) ? val.t : Const(val), ret.effects)
else
ret = isa(val, AbstractGlobal) ? val.t : Const(val)
Expand Down Expand Up @@ -675,7 +677,11 @@ end
function CC.abstract_eval_statement(analyzer::AbstractAnalyzer, @nospecialize(e), vtypes::VarTable, sv::InferenceState)
if istoplevel(sv)
if get_concretized(analyzer)[get_currpc(sv)]
@static if VERSION v"1.11.0-DEV.945"
return CC.RTEffects(Any, Any, CC.Effects()) # bail out if it has been interpreted by `ConcreteInterpreter`
else
return Any # bail out if it has been interpreted by `ConcreteInterpreter`
end
end
end

Expand Down
8 changes: 7 additions & 1 deletion src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,13 @@ function CC.concrete_eval_eligible(analyzer::JETAnalyzer,
@nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState)
if CC.is_nothrow(result.effects)
neweffects = CC.Effects(result.effects; nonoverlayed=true)
@static if VERSION v"1.11.0-DEV.945"
newresult = MethodCallResult(result.rt, result.exct, result.edgecycle, result.edgelimited,
result.edge, neweffects)
else
newresult = MethodCallResult(result.rt, result.edgecycle, result.edgelimited,
result.edge, neweffects)
end
res = @invoke CC.concrete_eval_eligible(analyzer::AbstractAnalyzer,
f::Any, newresult::MethodCallResult, arginfo::ArgInfo, sv::InferenceState)
@static if VERSION v"1.10.0-DEV.1345"
Expand Down Expand Up @@ -453,8 +458,9 @@ end
ret = @invoke CC.abstract_eval_basic_statement(analyzer::AbstractAnalyzer,
stmt::Any, pc_vartable::VarTable, frame::InferenceState)
if isexpr(stmt, :(=)) && (lhs = stmt.args[1]; isa(lhs, GlobalRef))
rt = @static VERSION v"1.11.0-DEV.945" ? ret.rt : ret.type
ReportPass(analyzer)(InvalidGlobalAssignmentError, analyzer,
frame, lhs.mod, lhs.name, ret.type)
frame, lhs.mod, lhs.name, rt)
end
return ret
end
Expand Down

0 comments on commit 98072a0

Please sign in to comment.