Skip to content
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

Fixed UBSan trip in GLFW OpenGL3 demo backend #518

Merged
merged 1 commit into from
Nov 24, 2022
Merged

Fixed UBSan trip in GLFW OpenGL3 demo backend #518

merged 1 commit into from
Nov 24, 2022

Conversation

Th3T3chn0G1t
Copy link
Contributor

Addressing #516

This resolves a false UBSan trip caused by treating the element offset in glDrawElements as a pointer
This parameter is effectively an offset but is taken as a void*. By not storing the offset as a pointer, UBSan no longer tools the offset to check for null pointer overflow.

OpenGL has a tendency to take offsets which are applied on the GPU as pointers, but they are just offsets so it's perfectly fine to do this.

This resolves a false UBSan trip caused by treating the element offset
in `glDrawElements` as a pointer
This parameter is effectively an offset but is taken as a `void*`
By not storing the offset as a pointer, UBSan no longer tools the offset
to check for null pointer overflow
@dumblob dumblob merged commit 7ae6d7d into Immediate-Mode-UI:master Nov 24, 2022
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.

None yet

2 participants