Skip to content

Prevent TimeStamps from being modified #821

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

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

CryZe
Copy link
Collaborator

@CryZe CryZe commented Jun 22, 2024

Our TimeStamp type is internally an Instant. The representation of Instant depends on the platform, but for many platforms it internally consists of unsigned numbers. For WASI its worse, because the moment the WASI VM starts, the time starts at 0. This means any subtraction from the time results in a numeric underflow and might panic. To prevent this from happening, TimeStamps can no longer be manually modified, they always represent valid points in time.

Our `TimeStamp` type is internally an `Instant`. The representation of
`Instant` depends on the platform, but for many platforms it internally
consists of unsigned numbers. For WASI its worse, because the moment the
WASI VM starts, the time starts at 0. This means any subtraction from
the time results in a numeric underflow and might panic. To prevent this
from happening, `TimeStamp`s can no longer be manually modified, they
always represent valid points in time.
@CryZe CryZe added bug There is a bug. enhancement An improvement for livesplit-core. priority: high This is a high priority issue. labels Jun 22, 2024
@CryZe CryZe added this to the v0.14 milestone Jun 22, 2024
@CryZe CryZe linked an issue Jun 22, 2024 that may be closed by this pull request
@CryZe CryZe merged commit ccc781e into LiveSplit:master Jun 22, 2024
70 checks passed
@CryZe CryZe deleted the no-time-stamp-modification branch June 22, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is a bug. enhancement An improvement for livesplit-core. priority: high This is a high priority issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Positive timer offsets can panic
1 participant