Commit 43a92710 authored by Duncan Coutts's avatar Duncan Coutts

Use signed comparison for +RTS -N x <= 0 test

Otherwise we can use +RTS -N-1 and get 2^32 or 2^64 capabilities
which doesn't work out so well...
parent 2daa3bd8
......@@ -1074,18 +1074,19 @@ error = rtsTrue;
RtsFlags.ParFlags.nNodes = getNumberOfProcessors();
#endif
} else {
RtsFlags.ParFlags.nNodes
= strtol(rts_argv[arg]+2, (char **) NULL, 10);
if (RtsFlags.ParFlags.nNodes <= 0) {
int nNodes;
nNodes = strtol(rts_argv[arg]+2, (char **) NULL, 10);
if (nNodes <= 0) {
errorBelch("bad value for -N");
error = rtsTrue;
}
#if defined(PROFILING)
if (RtsFlags.ParFlags.nNodes > 1) {
if (nNodes > 1) {
errorBelch("bad option %s: only -N1 is supported with profiling", rts_argv[arg]);
error = rtsTrue;
}
#endif
RtsFlags.ParFlags.nNodes = (nat)nNodes;
}
) break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment