From 96f2d802d9d1961c209b5c8a634a0ba36ee70494 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 16 Feb 2021 19:17:54 -0500 Subject: [PATCH] Adds a safeguard against undefined behaviour in the debugger. --- OSBindings/Mac/Clock Signal/Machine/CSMachine.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm index 3944bf37d..18f43f55b 100644 --- a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm +++ b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm @@ -723,7 +723,7 @@ struct ActivityObserver: public Activity::Observer { // _syncTime = 0 is used here as a sentinel to mark that a sync time is known; // this with the >= test ensures that no syncs are missed even if some sort of // performance problem is afoot (e.g. I'm debugging). - if(self->_syncTime && timeNow >= self->_syncTime) { + if(self->_syncTime && timeNow >= self->_syncTime && self->_syncTime >= lastTime) { splitAndSync = self->_isSyncLocking = self->_scanSynchroniser.can_synchronise(self->_machine->scan_producer()->get_scan_status(), self->_refreshPeriod); // If the time window is being split, run up to the split, then check out machine speed, possibly