Skip to content

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Mar 22, 2024

Arrays, surprisingly, are not sized to u64 on all platforms.

Fixes #122851.

r? @compiler-errors

cc @maurer

Arrays, surprisingly, are not sized to u64 on all platforms.
@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 22, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 22, 2024

Some changes occurred in compiler/rustc_symbol_mangling/src/typeid

cc @rust-lang/project-exploit-mitigations, @rcvalle

@maurer
Copy link
Contributor

maurer commented Mar 22, 2024

LGTM. I'm guessing the confusion (I had this too when reading the code) was expecting that to_u64 extracted the integer value, and then ::from'd it into a u64 rather than assuming that the actual enum arm was u64.

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 22, 2024

📌 Commit 861e470 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2024
@compiler-errors
Copy link
Member

compiler-errors commented Mar 22, 2024

Would it be possible to validate this fixes your problem locally @maurer?

No need to block the PR since it's strictly more correct imo

@workingjubilee
Copy link
Member Author

LGTM. I'm guessing the confusion (I had this too when reading the code) was expecting that to_u64 extracted the integer value, and then ::from'd it into a u64 rather than assuming that the actual enum arm was u64.

slightly more complicated encoding: we shove all ints inside 16-byte arrays and then read them back out, but track what our size was. that code was actually one of the first places I ever touched in compiler PRs.

@maurer
Copy link
Contributor

maurer commented Mar 22, 2024

Just confirmed that this removes the ICE in the build process that hit it originally.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 22, 2024
…inism, r=compiler-errors

Fix Itanium mangling usizes

Arrays, surprisingly, are not sized to u64 on all platforms.

Fixes rust-lang#122851.

r? `@compiler-errors`

cc `@maurer`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 22, 2024
…inism, r=compiler-errors

Fix Itanium mangling usizes

Arrays, surprisingly, are not sized to u64 on all platforms.

Fixes rust-lang#122851.

r? ``@compiler-errors``

cc ``@maurer``
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#121619 (Experimental feature postfix match)
 - rust-lang#122370 (Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`)
 - rust-lang#122537 (interpret/allocation: fix aliasing issue in interpreter and refactor getters a bit)
 - rust-lang#122542 (coverage: Clean up marker statements that aren't needed later)
 - rust-lang#122800 (Add `NonNull::<[T]>::is_empty`.)
 - rust-lang#122820 (Stop using `<DefId as Ord>` in various diagnostic situations)
 - rust-lang#122847 (Suggest `RUST_MIN_STACK` workaround on overflow)
 - rust-lang#122855 (Fix Itanium mangling usizes)
 - rust-lang#122863 (add more ice tests )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3164a47 into rust-lang:master Mar 22, 2024
@rustbot rustbot added this to the 1.79.0 milestone Mar 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
Rollup merge of rust-lang#122855 - workingjubilee:mangle-64-bit-chauvinism, r=compiler-errors

Fix Itanium mangling usizes

Arrays, surprisingly, are not sized to u64 on all platforms.

Fixes rust-lang#122851.

r? ```@compiler-errors```

cc ```@maurer```
@workingjubilee workingjubilee deleted the mangle-64-bit-chauvinism branch March 22, 2024 17:16
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 4, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#121619 (Experimental feature postfix match)
 - rust-lang#122370 (Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`)
 - rust-lang#122537 (interpret/allocation: fix aliasing issue in interpreter and refactor getters a bit)
 - rust-lang#122542 (coverage: Clean up marker statements that aren't needed later)
 - rust-lang#122800 (Add `NonNull::<[T]>::is_empty`.)
 - rust-lang#122820 (Stop using `<DefId as Ord>` in various diagnostic situations)
 - rust-lang#122847 (Suggest `RUST_MIN_STACK` workaround on overflow)
 - rust-lang#122855 (Fix Itanium mangling usizes)
 - rust-lang#122863 (add more ice tests )

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

CFI compilation of libcore on arm32 fails to encode array length
5 participants