Fix uninit r2 in divmod_u32u32_unsafe and divmod_s32s32_unsafe#2760
Open
andylinpersonal wants to merge 1 commit intoraspberrypi:developfrom
Open
Fix uninit r2 in divmod_u32u32_unsafe and divmod_s32s32_unsafe#2760andylinpersonal wants to merge 1 commit intoraspberrypi:developfrom
andylinpersonal wants to merge 1 commit intoraspberrypi:developfrom
Conversation
When the ``divmod_s32s32_unsafe`` and ``divmod_u32u32_unsafe`` is called without enabled ``PICO_DIVIDER_DISABLE_INTERRUPTS``, ``ldr r2, =SIO_BASE`` will be bypassed. Later access to ``SIO_DIV`` will crash. Fixes raspberrypi#2773 Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
18993c1 to
7099c5e
Compare
Contributor
|
good spot; i think i'd probably want to extract the unsafe variants into their own code/section (I doubt they are that ocmmonly used) to avoid the extra 2 cycles in the common divide code path |
Author
|
Maybe it's useful when used inside RTOS. In those case we can delegate the saving stuff to context-switch code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
divmod_s32s32_unsafeanddivmod_u32u32_unsafeis called without enabled
PICO_DIVIDER_DISABLE_INTERRUPTS,ldr r2, =SIO_BASEwill be bypassed. Later access toSIO_DIVwill crash.
Fixes #2773