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

rustc_metadata: don't break the version check when CrateRoot changes. #37931

Merged
merged 1 commit into from
Nov 24, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Nov 22, 2016

In #36551 I made rustc_version a field of CrateRoot, but despite it being the first field, one could still break the version check by changing CrateRoot so older compilers couldn't fully decode it (e.g. #37463).

This PR fixes #37803 by moving the version string back at the beginning of metadata, right after the 32-bit big-endian absolute position of CrateRoot, and by incrementing METADATA_VERSION.

@rust-highfive
Copy link
Collaborator

r? @arielb1

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

Copy link
Contributor

@jseyfried jseyfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eddyb
Copy link
Member Author

eddyb commented Nov 22, 2016

r? @jseyfried
@bors r=jseyfried

@bors
Copy link
Contributor

bors commented Nov 22, 2016

📌 Commit f4c68d2 has been approved by jseyfried

@rust-highfive rust-highfive assigned jseyfried and unassigned arielb1 Nov 22, 2016
@bors
Copy link
Contributor

bors commented Nov 23, 2016

⌛ Testing commit f4c68d2 with merge 1e45b63...

bors added a commit that referenced this pull request Nov 23, 2016
rustc_metadata: don't break the version check when CrateRoot changes.

In #36551 I made `rustc_version` a field of `CrateRoot`, but despite it being the first field, one could still break the version check by changing `CrateRoot` so older compilers couldn't fully decode it (e.g. #37463).

This PR fixes #37803 by moving the version string back at the beginning of metadata, right after the 32-bit big-endian absolute position of `CrateRoot`, and by incrementing `METADATA_VERSION`.
@bors bors merged commit f4c68d2 into rust-lang:master Nov 24, 2016
@eddyb eddyb deleted the meta-version branch November 24, 2016 03:12
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.

rustc index out of bounds libserialize\leb128.rs
5 participants