Skip to content

Commit 1e15769

Browse files
authored
Mark regex fns as nofree (#1654)
* Mark regex fns as nofree * more pcre
1 parent 87338e4 commit 1e15769

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/compiler.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ end
155155
end
156156

157157
const nofreefns = Set{String}((
158+
"pcre2_match_8",
159+
"julia.gcroot_flush",
160+
"pcre2_jit_stack_assign_8",
161+
"pcre2_match_context_create_8",
162+
"pcre2_jit_stack_create_8",
163+
"ijl_gc_enable_finalizers_internal", "jl_gc_enable_finalizers_internal",
164+
"pcre2_match_data_create_from_pattern_8",
158165
"ijl_gc_run_pending_finalizers", "jl_gc_run_pending_finalizers",
159166
"ijl_typeassert", "jl_typeassert",
160167
"ijl_f_isdefined", "jl_f_isdefined",
@@ -239,6 +246,7 @@ const nofreefns = Set{String}((
239246
))
240247

241248
const inactivefns = Set{String}((
249+
"pcre2_match_data_create_from_pattern_8",
242250
"ijl_typeassert", "jl_typeassert",
243251
"ijl_f_isdefined", "jl_f_isdefined",
244252
"ijl_field_index", "jl_field_index",

src/internal_rules.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ end
109109
function EnzymeRules.inactive_noinl(::typeof(Base.hasproperty), args...)
110110
return nothing
111111
end
112+
function EnzymeRules.inactive(::typeof(Base.startswith), ::AbstractString, args...)
113+
return nothing
114+
end
112115

113116
if VERSION >= v"1.9"
114117
Enzyme.EnzymeRules.inactive_noinl(::typeof(Core._compute_sparams), args...) = nothing

src/rules/typeunstablerules.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ function common_finalizer_fwd(offset, B, orig, gutils, normalR, shadowR)
14231423
return false
14241424
end
14251425

1426-
function common_finalizer_augfwd(offset, B, orig, gutils, normalR, shadowR)
1426+
function common_finalizer_augfwd(offset, B, orig, gutils, normalR, shadowR, tapeR)
14271427
if is_constant_value(gutils, orig) && is_constant_inst(gutils, orig)
14281428
return true
14291429
end

0 commit comments

Comments
 (0)