Skip to content

Correct code for operations on empty Vecs #24604

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

Closed
wants to merge 1 commit into from

Conversation

pczarn
Copy link
Contributor

@pczarn pczarn commented Apr 19, 2015

Corrected a few cases of using an invalid pointer 0x1. Even taking an offset of 0 leads to undefined behavior.

@rust-highfive
Copy link
Contributor

r? @gankro

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

@Gankra
Copy link
Contributor

Gankra commented Apr 19, 2015

Does offsetting by 0 invoke UB, though?

@Gankra
Copy link
Contributor

Gankra commented Apr 19, 2015

If the inbounds keyword is present, the result value of the getelementptr is a poison value if the base pointer is not an in bounds address of an allocated object

So yes this change seems to be necesssary

@Gankra
Copy link
Contributor

Gankra commented Apr 19, 2015

LGTM

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 19, 2015

📌 Commit 17531a6 has been approved by Gankro

@bors
Copy link
Collaborator

bors commented Apr 20, 2015

⌛ Testing commit 17531a6 with merge 385e300...

@bors
Copy link
Collaborator

bors commented Apr 20, 2015

💔 Test failed - auto-linux-64-nopt-t

@pczarn
Copy link
Contributor Author

pczarn commented Apr 21, 2015

There are many more changes needed in core::slice. I think it would be straightforward to make heap::EMPTY point to something. However, consts can't obtain addresses of statics, is that right?

@Gankra
Copy link
Contributor

Gankra commented Apr 22, 2015

CC @Aatch on the above language question.

@bors
Copy link
Collaborator

bors commented Apr 22, 2015

☔ The latest upstream changes (presumably #24674) made this pull request unmergeable. Please resolve the merge conflicts.

@Gankra
Copy link
Contributor

Gankra commented May 15, 2015

@pczarn ping

@Gankra
Copy link
Contributor

Gankra commented May 31, 2015

Closing as inactive

@Gankra Gankra closed this May 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants