-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Check index value <= 0xFFFF_FF00
#125821
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
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))?; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This comment has been minimized.
This comment has been minimized.
I have no idea why the index in the error report is being changed to Edit: error report index is |
This comment has been minimized.
This comment has been minimized.
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (acaf0ae): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis 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. CyclesResults (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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.888s -> 667.575s (-0.20%) |
fixes #121126
check
idx <= FieldIdx::MAX_AS_U32
before callingFieldIdx::from_u32
to avoid panic.