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 incorrect types of pointers #465

Merged
merged 2 commits into from May 20, 2024
Merged

Conversation

ferjakub
Copy link
Contributor

1/ isolate_handle.cc:

snapshot.data, which is allocated by V8 as new char[] (snapshot.cc:546) is owned by snapshot_data_ptr, which is of type unique_ptr<const char> => delete is called upon destruction, delete[] should be called instead

=> changed the type of the unique_ptr to reflect this


2/ scheduler.cc:

uv_async is allocated as uv_async_t (128 B) but deleted as uv_handle_t (96 B)

=> added a cast back from uv_handle_t* to uv_async_t* before deleting


Technically, these situations are UB, but practically they don't cause any issues. They came up as a result of running the test suite with ASan which doesn't complain anymore after this trivial fix.

@laverdet laverdet merged commit d00be92 into laverdet:main May 20, 2024
@laverdet
Copy link
Owner

Thanks!

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.

None yet

2 participants