Skip to content

Commit

Permalink
Probably due to #23397; ensure the istart variable is declared outsid…
Browse files Browse the repository at this point in the history
…e the while loop
  • Loading branch information
quinnj committed Sep 5, 2017
1 parent fdef237 commit 4c0a3e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/cartesian.jl
Expand Up @@ -302,6 +302,7 @@ function lreplace!(str::AbstractString, r::LReplace)
pat = r.pat_str
j = start(pat)
matching = false
local istart::Int
while !done(str, i)
cstr, i = next(str, i)
if !matching
Expand Down
2 changes: 2 additions & 0 deletions test/cartesian.jl
Expand Up @@ -3,3 +3,5 @@
@test Base.Cartesian.exprresolve(:(1 + 3)) == 4
ex = Base.Cartesian.exprresolve(:(if 5 > 4; :x; else :y; end))
@test ex.args[2] == QuoteNode(:x)

@test Base.Cartesian.lreplace!("val_col", Base.Cartesian.LReplace{String}(:col, "col", 1)) == "val_1"

0 comments on commit 4c0a3e6

Please sign in to comment.