Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Fix undefined behaviors #288

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Fix undefined behaviors #288

merged 2 commits into from
Feb 12, 2024

Conversation

fuzun
Copy link
Contributor

@fuzun fuzun commented Feb 11, 2024

This merge request fixes two undefined behaviors found by using Undefined Behavior Sanitizer.

getActiveIcon() may be called before ActiveIcon
is initialized, leading to undefined behavior.
@fuzun fuzun force-pushed the undefinedbehaviorfix branch from 797edbc to 6a51e01 Compare February 11, 2024 19:59
Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. (Though as said a comment would be good to have.)

Haven't tested, but this does pretty obviously not introduce a regression.

header struct is packed, and `core::max_()` takes the input as reference.
@fuzun fuzun force-pushed the undefinedbehaviorfix branch from 6a51e01 to 10e2e62 Compare February 11, 2024 20:09
@sfan5 sfan5 merged commit 0dab737 into minetest:master Feb 12, 2024
19 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants