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

Revert "Initialize all ghost item member (Closed #8297)" #8327

Merged

Conversation

heinrich5991
Copy link
Member

This reverts commit f319ed2.

Initializing these variables with junk data doesn't seem to be an improvement over not initializing them. It hides potential Valgrind warnings about data accesses to uninitialized memory though.

f319ed2#r1590801501

Checklist

  • Tested the change ingame
  • Provided screenshots if it is a visual change
  • Tested in combination with possibly related configuration options
  • Written a unit test (especially base/) or added coverage to integration test
  • Considered possible null pointers and out of bounds array indexing
  • Changed no physics that affect existing maps
  • Tested the change with ASan+UBSan or valgrind's memcheck (optional)

This reverts commit f319ed2.

Initializing these variables with junk data doesn't seem to be an
improvement over not initializing them. It hides potential Valgrind
warnings about data accesses to uninitialized memory though.

ddnet@f319ed2#r1590801501
@ChillerDragon
Copy link
Contributor

So remove this then?

https://github.com/ddnet/ddnet/pull/8288/files#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055R160

Class member variables should be initialized where they are declared

I thought we want to avoid access to uninitliazed memory?

@def- def- added this pull request to the merge queue May 8, 2024
Merged via the queue into ddnet:master with commit 587b545 May 8, 2024
16 checks passed
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

3 participants