aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-04-24 17:18:53 +0200
committerRickard Green <[email protected]>2017-04-24 17:18:53 +0200
commitbf2e5951dbd6398b71e32fd1cfb72b2870280280 (patch)
treee7068dbf268112074bedef367c51078a24c0f4bb /erts/emulator
parent739bca3fc267c55d84c8f5c193d16c0b2a7eee13 (diff)
downloadotp-bf2e5951dbd6398b71e32fd1cfb72b2870280280.tar.gz
otp-bf2e5951dbd6398b71e32fd1cfb72b2870280280.tar.bz2
otp-bf2e5951dbd6398b71e32fd1cfb72b2870280280.zip
Fix assert in dbg_verify_empty_later_slots()
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/time.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c
index cee3cb619f..a7e5a64b22 100644
--- a/erts/emulator/beam/time.c
+++ b/erts/emulator/beam/time.c
@@ -1364,21 +1364,29 @@ dbg_verify_empty_later_slots(ErtsTimerWheel *tiw, ErtsMonotonicTime to_pos)
tmp = to_pos;
tmp &= ERTS_TW_LATER_WHEEL_POS_MASK;
if (tmp > tiw->later.pos) {
+ ErtsMonotonicTime pos_min;
int slots;
tmp -= tiw->later.pos;
tmp /= ERTS_TW_LATER_WHEEL_SLOT_SIZE;
ERTS_TW_ASSERT(tmp > 0);
+
+ pos_min = tiw->later.pos;
+
if (tmp < (ErtsMonotonicTime) ERTS_TW_LATER_WHEEL_SIZE)
slots = (int) tmp;
- else
+ else {
+ pos_min += ((tmp / ERTS_TW_LATER_WHEEL_SIZE)
+ * ERTS_TW_LATER_WHEEL_SLOT_SIZE);
slots = ERTS_TW_LATER_WHEEL_SIZE;
+ }
while (slots > 0) {
ErtsTWheelTimer *tmr = tiw->w[ix];
+ pos_min += ERTS_TW_LATER_WHEEL_SLOT_SIZE;
if (tmr) {
ErtsTWheelTimer *end = tmr;
do {
- ERTS_TW_ASSERT(tmr->timeout_pos > to_pos);
+ ERTS_TW_ASSERT(tmr->timeout_pos >= pos_min);
tmr = tmr->next;
} while (tmr != end);
}