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.
1/
isolate_handle.cc
:snapshot.data
, which is allocated by V8 asnew char[]
(snapshot.cc:546) is owned bysnapshot_data_ptr
, which is of typeunique_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 asuv_async_t
(128 B) but deleted asuv_handle_t
(96 B)=> added a cast back from
uv_handle_t*
touv_async_t*
before deletingTechnically, 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.