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

Check index value <= 0xFFFF_FF00 #125821

Merged
merged 1 commit into from
Jun 1, 2024
Merged

Conversation

Luv-Ray
Copy link
Contributor

@Luv-Ray Luv-Ray commented May 31, 2024

fixes #121126

check idx <= FieldIdx::MAX_AS_U32 before calling FieldIdx::from_u32 to avoid panic.

@rustbot
Copy link
Collaborator

rustbot commented May 31, 2024

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 May 31, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 31, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

let idx = prop.ecx.read_target_usize(idx).ok()?;
fields.get(FieldIdx::from_u32(idx.try_into().ok()?)).unwrap_or(&Value::Uninit)
let idx = prop.ecx.read_target_usize(idx).ok()?.try_into().ok()?;
let idx = (idx <= FieldIdx::MAX_AS_U32).then(|| FieldIdx::from_u32(idx))?;
Copy link
Member

Choose a reason for hiding this comment

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

The .then chaining here is confusing. Can you just use an if statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@rust-log-analyzer

This comment has been minimized.

@Luv-Ray
Copy link
Contributor Author

Luv-Ray commented May 31, 2024

I have no idea why the index in the error report is being changed to usize::MAX, maybe I need some time to investigate.
Any help would be greatly appreciated.

Edit: error report index is usize::MAX because the test is on the 32-bit platform, which u32::MAX == usize::MAX and usize::MAX has a higher priority to display. Just use u32::MAX - 1 to test is okay (the ice happens on all values between 0xFFFF_FF00 + 1 and u32::MAX).

@rust-log-analyzer

This comment has been minimized.

@fee1-dead
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 1, 2024

📌 Commit d3c8e67 has been approved by fee1-dead

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 Jun 1, 2024
@bors
Copy link
Contributor

bors commented Jun 1, 2024

⌛ Testing commit d3c8e67 with merge acaf0ae...

@bors
Copy link
Contributor

bors commented Jun 1, 2024

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing acaf0ae to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 1, 2024
@bors bors merged commit acaf0ae into rust-lang:master Jun 1, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone Jun 1, 2024
@Luv-Ray Luv-Ray deleted the issue#121126 branch June 1, 2024 14:46
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (acaf0ae): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -2.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-5.2%, -2.0%] 14
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 668.888s -> 667.575s (-0.20%)
Artifact size: 318.81 MiB -> 318.75 MiB (-0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

ICE: assertion failed: value <= 0xFFFF_FF00
7 participants