Skip to content

Fixing UB in fastpow#23

Open
turborium wants to merge 1 commit intotorvalds:mainfrom
turborium:patch-1
Open

Fixing UB in fastpow#23
turborium wants to merge 1 commit intotorvalds:mainfrom
turborium:patch-1

Conversation

@turborium
Copy link
Copy Markdown

Fixing UB in fastpow

Fixing UB in fastpow
@NoelJB
Copy link
Copy Markdown

NoelJB commented Jan 12, 2026

I perceive that your intent is to ensure that the memory moves are correctly sized, but why not make the simpler fix of including stdint.h and changing the integer to int32_t? The float type is already standardized as 32-bit by IEEE.

Thoughts?

@qasim78678
Copy link
Copy Markdown

Good point, that would definitely be a cleaner and more readable fix.
Using int32_t makes the intent explicit and avoids relying on assumptions about int size. I can update the patch to include <stdint.h> and switch to int32_t instead. Thanks for pointing that out.

@dannythehumbleguy
Copy link
Copy Markdown

Top notch fix, It must be approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants