Skip to content

Commit 124a210

Browse files
committed
Improve guard
1 parent c0deddb commit 124a210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/core_arch/src/arm/neon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ macro_rules! arm_vget_lane {
14771477
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
14781478
#[cfg_attr(test, assert_instr(umov))]
14791479
pub unsafe fn $name(v: $from, lane: i32) -> $to {
1480-
if lane > $lanes {
1480+
if lane < 0 || lane > $lanes {
14811481
unreachable_unchecked()
14821482
}
14831483
simd_extract(v, lane as u32)

0 commit comments

Comments
 (0)