Skip to content

Commit

Permalink
Fix a bootstrapping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Apr 11, 2022
1 parent 309f536 commit 261c63b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions base/expr.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

isexpr(@nospecialize(ex), heads) = isa(ex, Expr) && in(ex.head, heads)
isexpr(@nospecialize(ex), heads, n::Int) = isa(ex, Expr) && in(ex.head, heads) && length(ex.args) == n
const is_expr = isexpr

## symbols ##

"""
Expand Down
3 changes: 1 addition & 2 deletions base/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ julia> Meta.isexpr(ex, :call, 2)
true
```
"""
isexpr(@nospecialize(ex), heads) = isa(ex, Expr) && in(ex.head, heads)
isexpr(@nospecialize(ex), heads, n::Int) = isa(ex, Expr) && in(ex.head, heads) && length(ex.args) == n
isexpr

"""
replace_sourceloc!(location, expr)
Expand Down
2 changes: 0 additions & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,6 @@ function operator_associativity(s::Symbol)
return :left
end

const is_expr = isexpr

is_quoted(ex) = false
is_quoted(ex::QuoteNode) = true
is_quoted(ex::Expr) = is_expr(ex, :quote, 1) || is_expr(ex, :inert, 1)
Expand Down
4 changes: 2 additions & 2 deletions base/strings/lazy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ macro lazy_str(text)
end

function String(l::LazyString)
old = @atomic :acquire l.str
old = getfield(l, :str, :acquire)
old === nothing || return old
str = sprint() do io
for p in l.parts
print(io, p)
end
end
old = @atomicswap :acquire_release l.str = str
old = swapfield!(l, :str, str, :acquire_release)
return something(old, str)
end

Expand Down

0 comments on commit 261c63b

Please sign in to comment.