Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: runtime/bin/eventhandler_macos.cc

Issue 2635253002: VM eventhandler: Read "old" event mask before it can be modified. (Closed)
Patch Set: Revert previous changes. Read correct old_mask. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_macos.cc
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index 640f05a5408521b9287fbcff029b918417fe5bff..ea0d5dabb2866648ba9f10732d388bf5dfaf65fc 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -388,6 +388,7 @@ void EventHandlerImplementation::HandleEvents(struct kevent* events, int size) {
interrupt_seen = true;
} else {
DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(events[i].udata);
+ const intptr_t old_mask = di->Mask();
intptr_t event_mask = GetEvents(events + i, di);
if ((event_mask & (1 << kErrorEvent)) != 0) {
di->NotifyAllDartPorts(event_mask);
@@ -395,7 +396,6 @@ void EventHandlerImplementation::HandleEvents(struct kevent* events, int size) {
event_mask &= ~(1 << kErrorEvent);
if (event_mask != 0) {
- intptr_t old_mask = di->Mask();
Dart_Port port = di->NextNotifyDartPort(event_mask);
ASSERT(port != 0);
UpdateKQueueInstance(old_mask, di);
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698