-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix: Remove instances of undefined behavior #1652
base: main
Are you sure you want to change the base?
Conversation
…e and trust the compiler to optimize it out
make sure to check foot races in AG show the correct times at game end 👍 |
@@ -146,7 +146,7 @@ void WriteSd0Magic(char* input, uint32_t chunkSize) { | |||
input[2] = '0'; | |||
input[3] = 0x01; | |||
input[4] = 0xFF; | |||
*reinterpret_cast<uint32_t*>(input + 5) = chunkSize; // Write the integer to the character array | |||
std::memcpy(&input[5], &chunkSize, sizeof(uint32_t)); // Write the integer to the character array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is a bit harder to test, but ill send you a test case for it
@@ -54,6 +54,7 @@ struct AssetStream : std::istream { | |||
} | |||
|
|||
operator bool() { | |||
// NEED TO FIX THIS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is changed make sure to check files existing and not existing with both packed and unpacked clients
Tested it, and it looks good. Still need to address a few other things. |
Hooked up the sanitizer to try and track down any UB in our codebase