[ubsan] Fix parameter type mismatch ubsan for DestroyWatch callback.

Fixes https://github.com/dart-lang/sdk/issues/62365
TEST=ci

Change-Id: I70232a592c3382b1833eeffa499e713ef2cadbc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471342
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev
2026-01-12 09:41:47 -08:00
committed by Commit Queue
parent a50083ef29
commit b4c47fd691
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ class FileSystemWatcher {
static Dart_Handle ReadEvents(intptr_t id, intptr_t path_id);
#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_WINDOWS)
static void DestroyWatch(intptr_t path_id);
static void DestroyWatch(void* ptr);
#endif
static void set_delayed_filewatch_callback(bool value) {
+3 -2
View File
@@ -326,7 +326,8 @@ void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) {
Node::Unwatch(reinterpret_cast<Node*>(path_id));
}
void FileSystemWatcher::DestroyWatch(intptr_t path_id) {
void FileSystemWatcher::DestroyWatch(void* ptr) {
intptr_t path_id = reinterpret_cast<intptr_t>(ptr);
FileSystemWatcher::UnwatchPath(0, path_id);
}
@@ -363,7 +364,7 @@ bool FileSystemWatcher::IsSupported() {
void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) {}
void FileSystemWatcher::DestroyWatch(intptr_t path_id) {}
void FileSystemWatcher::DestroyWatch(void* ptr) {}
void FileSystemWatcher::InitOnce() {}
+2 -1
View File
@@ -62,7 +62,8 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id,
return reinterpret_cast<intptr_t>(handle);
}
void FileSystemWatcher::DestroyWatch(intptr_t path_id) {
void FileSystemWatcher::DestroyWatch(void* ptr) {
intptr_t path_id = reinterpret_cast<intptr_t>(ptr);
FileSystemWatcher::UnwatchPath(0, path_id);
}