Skip to content

Commit

Permalink
fixup! improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Sep 19, 2023
1 parent 603f321 commit 67af16e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ end

array_new_memory(mem::Memory, newlen::Int) = typeof(mem)(undef, newlen) # TODO: when implemented, this should use a memory growing call

@assume_effects :terminates_locally function _growbeg!(a::Vector, delta::Integer)
function _growbeg!(a::Vector, delta::Integer)
delta = Int(delta)
delta == 0 && return # avoid attempting to index off the end
delta >= 0 || throw(ArgumentError("grow requires delta >= 0"))
Expand Down Expand Up @@ -1156,7 +1156,7 @@ array_new_memory(mem::Memory, newlen::Int) = typeof(mem)(undef, newlen) # TODO:
return
end

@assume_effects :terminates_locally function _growend!(a::Vector, delta::Integer)
function _growend!(a::Vector, delta::Integer)
delta = Int(delta)
delta >= 0 || throw(ArgumentError("grow requires delta >= 0"))
ref = a.ref
Expand Down Expand Up @@ -1193,7 +1193,7 @@ end
return
end

@assume_effects :terminates_locally function _growat!(a::Vector, i::Integer, delta::Integer)
function _growat!(a::Vector, i::Integer, delta::Integer)
delta = Int(delta)
i == 1 && return _growbeg!(a, delta)
len = length(a)
Expand Down
3 changes: 2 additions & 1 deletion base/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ macro assume_effects(args...)
end
(consistent, effect_free, nothrow, terminates_globally, terminates_locally, notaskstate, inaccessiblememonly, noub) =
(false, false, false, false, false, false, false, false, false)
for org_setting in args[1:idx]
for i in 1:idx
org_setting = args[i]
(setting, val) = compute_assumed_setting(org_setting)
if setting === :consistent
consistent = val
Expand Down

0 comments on commit 67af16e

Please sign in to comment.