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 type alias violation in scanner #426

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

yangchi
Copy link
Contributor

@yangchi yangchi commented Sep 10, 2024

The cast from buffer which is char* to uint16_t* is a type alias violation.
If tree-sitter-scala is build with UBSAN enabled this is a runtime error.
This PR fixes it by replacing these cast + assignment with just plain old memcpy.

Copy link
Collaborator

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yangchi
Copy link
Contributor Author

yangchi commented Sep 10, 2024

I'm getting the following error in windows-latest test on GH actions:

Could not find 'D:\a\tree-sitter-scala\tree-sitter-scala\bindings\node\*_test.js'

Did I miss some steps to generate some files, or is this unrelated to my change? If it's the latter, is there an easy way for me to rerun the checks? Thank you!

@eed3si9n
Copy link
Collaborator

CI I think is broken and I've been trying to send a PR to fix it (#425). I'm guessing this is unrelated to your change.

@yangchi
Copy link
Contributor Author

yangchi commented Sep 10, 2024

I see. I can wait for #425 to go in first. Thank you!

@eed3si9n eed3si9n merged commit ec13dd6 into tree-sitter:master Sep 12, 2024
5 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.

2 participants