tree-sitter / tree-sitter-scala

Scala grammar for tree-sitter
MIT License
158 stars 55 forks source link

Fix type alias violation in scanner #426

Closed yangchi closed 1 month ago

yangchi commented 1 month ago

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.

yangchi commented 1 month ago

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 commented 1 month ago

CI I think is broken and I've been trying to send a PR to fix it (https://github.com/tree-sitter/tree-sitter-scala/pull/425). I'm guessing this is unrelated to your change.

yangchi commented 1 month ago

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