Skip to content

Fix predecessor blocks on 1.11 #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "Tape based task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.9.3"
version = "0.9.4"

[deps]
MistyClosures = "dbe65cb8-6be2-42dd-bbc5-4196aaced4f4"
Expand All @@ -14,7 +14,7 @@ Aqua = "0.8.11"
JuliaFormatter = "1.0.62"
MistyClosures = "2.0.0"
Test = "1"
julia = "1.10.8"
julia = "~1.10.8, 1.11.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
6 changes: 6 additions & 0 deletions src/bbcode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ function _control_flow_graph(blks::Vector{BBlock})::Core.Compiler.CFG
preds = map(id -> sort(map(p -> id_to_num[p], preds_ids[id])), block_ids)
succs = map(id -> sort(map(s -> id_to_num[s], succs_ids[id])), block_ids)

# Predecessor of entry block is `0`. This needs to be added in manually.
@static if VERSION >= v"1.11.6"
push!(preds[1], 0)
end

# Compute the statement numbers associated to each basic block.
index = vcat(0, cumsum(map(length, blks))) .+ 1
basic_blocks = map(eachindex(blks)) do n
stmt_range = Core.Compiler.StmtRange(index[n], index[n + 1] - 1)
Expand Down
Loading