Skip to content

Commit 624e645

Browse files
committed
Don't set negative adjepoch to zero
1 parent 391d8ad commit 624e645

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/rwlmain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* History
1313
*
14-
* bengsig 14-dec-2022 - Move RWL-059 check till after -x processing
14+
* bengsig 14-dec-2022 - Move RWL-059 check; don't set adj to 0 when neg
1515
* bengsig 24-nov-2022 - Arguments are all positional in generated
1616
* bengsig 31-oct-2022 - Add better queue time via $queueeverytiming:on
1717
* bengsig 15-sep-2022 - New file assignment operators
@@ -1365,7 +1365,7 @@ sb4 main(sb4 main_ac, char **main_av)
13651365
if (rwm->adjepoch <0.0)
13661366
{
13671367
rwlerror(rwm, RWL_ERROR_CLOCKOFF_NEGATIVE, rwm->adjepoch);
1368-
rwm->adjepoch = 0.0;
1368+
// don't do this: rwm->adjepoch = 0.0;
13691369
}
13701370
if (rwm->adjepoch >600.0)
13711371
{

src/rwlmisc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*
1515
* History
1616
*
17+
* bengsig 14-dec-2022 - assert for persec out of bounds
1718
* bengsig 31-oct-2022 - Add better queue time via $queueeverytiming:on
1819
* bengsig 18-oct-2022 - only histogram when > 100 µs
1920
* bengsig 18-oct-2022 - threads global variables
@@ -1080,6 +1081,12 @@ void rwlstatsincr(rwl_xeqenv *xev , rwl_identifier *var , rwl_location *eloc , d
10801081
s->etimsum = ne;
10811082
s->pssize = ns;
10821083
}
1084+
if (i_sec >= s->pssize)
1085+
{
1086+
rwlexecsevere(xev, eloc, "[rwlstatsincr-outofbounds:%d;%d]"
1087+
, i_sec, s->pssize);
1088+
return;
1089+
}
10831090
// If we are flushing persec, mutex the increase
10841091
RWL_SRC_ERROR_FRAME
10851092
if (xev->rwm->flushstop)

0 commit comments

Comments
 (0)