Skip to content
Snippets Groups Projects
Commit 2d0131da authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix a division-by-zero when +RTS -V0 is given

In delayzh_fast we act as if tickInterval was 50, not 0.
parent b84b5969
No related merge requests found
......@@ -2118,7 +2118,11 @@ delayzh_fast
W_ time;
W_ divisor;
(time) = foreign "C" getourtimeofday() [R1];
divisor = TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags))*1000;
divisor = TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags));
if (divisor == 0) {
divisor = 50;
}
divisor = divisor * 1000;
target = ((R1 + divisor - 1) / divisor) /* divide rounding up */
+ time + 1; /* Add 1 as getourtimeofday rounds down */
StgTSO_block_info(CurrentTSO) = target;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment