Skip to content

Commit

Permalink
Fix sense of unsigned wrapping test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wren6991 committed Nov 5, 2024
1 parent 50e8188 commit 7042d56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rp2_common/hardware_xip_cache/xip_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ __always_inline static void check_xip_offset_range(uintptr_t start_offset, uintp
(void)size_bytes;
valid_params_if(HARDWARE_XIP_CACHE, start_offset <= XIP_CACHE_ADDRESS_SPACE_SIZE);
valid_params_if(HARDWARE_XIP_CACHE, start_offset + size_bytes <= XIP_CACHE_ADDRESS_SPACE_SIZE);
valid_params_if(HARDWARE_XIP_CACHE, start_offset + size_bytes <= start_offset);
// Check for unsigned wrapping too:
valid_params_if(HARDWARE_XIP_CACHE, start_offset + size_bytes >= start_offset);
}

#if !PICO_RP2040
Expand Down

0 comments on commit 7042d56

Please sign in to comment.