Skip to content
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

Split dummy-idx node to fix expand_givens DFS #31442

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Feb 6, 2016

Split dummy-idx node to fix expand_givens DFS

(Much more detail in commit comments.)

Fix #30438.

@rust-highfive
Copy link
Collaborator

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@arielb1
Copy link
Contributor

arielb1 commented Feb 6, 2016

I would just split dummy_idx to a src and dst part. Either that or have the comments less uncertain.

@arielb1
Copy link
Contributor

arielb1 commented Feb 6, 2016

I found that bug independently (that's what I deserve for going bug-hunting with such a huge notification backlog), and it was the same givens bug.

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 6, 2016

Ah yeah splitting dummy_idx sounds better in nearly every way. I'll do that tomorrow

@pnkfelix pnkfelix force-pushed the issue-30438-sidestep-dummy-node-during-expand-givens-dfs branch from 544dafc to 77c8850 Compare February 8, 2016 12:07
@pnkfelix pnkfelix changed the title Sidestep dummy-idx node during expand_givens DFS Split dummy-idx node to fix expand_givens DFS Feb 8, 2016
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 8, 2016

Also, this fix is so simple that I'm nominating it to be merged to beta as well.

@pnkfelix pnkfelix added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 8, 2016
…odes.

Why do this: The RegionGraph representation previously conflated all
of the non-variable regions (i.e. the concrete regions such as
lifetime parameters to the current function) into a single dummy node.

A single dummy node leads DFS on a graph `'a -> '_#1 -> '_#0 -> 'b` to
claim that `'_#1` is reachable from `'_#0` (due to `'a` and `'b` being
conflated in the graph representation), which is incorrect (and can
lead to soundness bugs later on in compilation, see rust-lang#30438).

Splitting the dummy node ensures that DFS will never introduce new
ancestor relationships between nodes for variable regions in the
graph.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 8, 2016

📌 Commit 77c8850 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Feb 8, 2016

⌛ Testing commit 77c8850 with merge 04f12ef...

bors added a commit that referenced this pull request Feb 8, 2016
…g-expand-givens-dfs, r=nikomatsakis

Split dummy-idx node to fix expand_givens DFS

(Much more detail in commit comments.)

Fix #30438.
@bors bors merged commit 77c8850 into rust-lang:master Feb 8, 2016
@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Feb 11, 2016
@nikomatsakis
Copy link
Contributor

We don't normally backport random fixes, but this seems like both a severe problem (unsoundness and a kind of random one) and a simple fix, so go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault in safe code caused by a use after drop when using index sugar
6 participants