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

fix(lib): a null clock must have tv_nsec be 0 as well #3372

Merged
merged 1 commit into from
May 19, 2024

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented May 19, 2024

Closes #3341

In a WASM environment, it seems like calling clock_gettime with CLOCK_MONOTONIC gives us a really small time at first; it could be related to when the program starts, I'm not sure. The problem is our check for clock_is_null only checks if tv_sec is 0, and when we first set end_clock, it is set to a value where tv_sec is 0, and tv_nsec is some large number, around 0.05-0.1s in my testing. So we should also check for tv_nsec being non-zero before assuming a clock is null/none.

@amaanq amaanq requested a review from maxbrunsfeld May 19, 2024 05:18
@amaanq amaanq merged commit ae35a36 into tree-sitter:master May 19, 2024
12 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.

setTimeoutMicros doesn't appear to work in the latest versions of web-tree-sitter
2 participants