Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
obsidiansystems
GHC
Commits
2d0131da
Commit
2d0131da
authored
Apr 26, 2008
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/PrimOps.cmm
View file @
2d0131da
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment