Skip to content

Commit ff8998f

Browse files
authored
Switch to is_quotenode_egal for invalidation-resistance (#68)
Packages that specialize `==` could invalidate the former code, this makes it resistant.
1 parent e836f50 commit ff8998f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/LoweredCodeUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module LoweredCodeUtils
1111

1212
using JuliaInterpreter
1313
using JuliaInterpreter: SSAValue, SlotNumber, Frame
14-
using JuliaInterpreter: @lookup, moduleof, pc_expr, step_expr!, is_global_ref, is_quotenode, whichtt,
14+
using JuliaInterpreter: @lookup, moduleof, pc_expr, step_expr!, is_global_ref, is_quotenode_egal, whichtt,
1515
next_until!, finish_and_return!, get_return, nstatements, codelocation, linetable,
1616
is_return, lookup_return, is_GotoIfNot, is_ReturnNode
1717

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ function typedef_range(src::CodeInfo, idx)
135135
(stmt.head === :global || stmt.head === :return) && break
136136
if stmt.head === :call
137137
if (is_global_ref(stmt.args[1], Core, :_typebody!) ||
138-
isdefined(Core, :_typebody!) && is_quotenode(stmt.args[1], Core._typebody!))
138+
isdefined(Core, :_typebody!) && is_quotenode_egal(stmt.args[1], Core._typebody!))
139139
have_typebody = true
140140
elseif (is_global_ref(stmt.args[1], Core, :_equiv_typedef) ||
141-
isdefined(Core, :_equiv_typedef) && is_quotenode(stmt.args[1], Core._equiv_typedef))
141+
isdefined(Core, :_equiv_typedef) && is_quotenode_egal(stmt.args[1], Core._equiv_typedef))
142142
have_equivtypedef = true
143143
# Advance to the type-assignment
144144
while iend <= n

0 commit comments

Comments
 (0)