Skip to content

Commit ba9be03

Browse files
authored
Tag return bifurcations too (#93)
Fixes a Revise `sigtest.jl` failure, LoadError: invalid redefinition of constant RandomDevice on Windows with Julia 1.6.
1 parent f9d80e2 commit ba9be03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/codeedges.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ function add_control_flow!(isrequired, cfg, paths::AbstractVector{Path})
769769
for (ibb, bb) in enumerate(blocks)
770770
r = rng(bb)
771771
if any(view(isrequired, r))
772-
# Check if the exit of this block is a GotoNode
773-
if length(bb.succs) == 1
772+
# Check if the exit of this block is a GotoNode or `return`
773+
if length(bb.succs) < 2 && ibb < nblocks
774774
idxlast = r[end]
775775
_changed |= !isrequired[idxlast]
776776
isrequired[idxlast] = true

0 commit comments

Comments
 (0)