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

Common/Timer: Fix integer underflow in Timer::GetDoubleTime for dates before ~2008. #8950

Merged
merged 1 commit into from Jul 12, 2020

Conversation

jordan-woyak
Copy link
Member

Dates before ~2008 underflowed in a u64 and were then converted to a u32.

The year 2000 was saved as 2136.

https://bugs.dolphin-emu.org/issues/12119

Other code in this file assumes the time_t epoch is 1970 so I'm making that same assumption.
We can safely use time_since_epoch when we switch to C++20.

Do we want to add some hax to read times that were saved incorrectly?
I don't think it's worth it.

@JMC47 JMC47 merged commit 3c70fb7 into dolphin-emu:master Jul 12, 2020
10 checks passed
@jordan-woyak jordan-woyak deleted the double-time-fix branch July 12, 2020 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants