浏览代码

Merge pull request #677 from jakesmith/loopmaxiterations

Protect LOOP maxIterations from going negative
Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 13 年之前
父节点
当前提交
2f8865984e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      thorlcr/activities/loop/thloopslave.cpp

+ 1 - 0
thorlcr/activities/loop/thloopslave.cpp

@@ -215,6 +215,7 @@ public:
         eof = false;
         helper->createParentExtract(extractBuilder);
         maxIterations = helper->numIterations();
+        if ((int)maxIterations < 0) maxIterations = 0;
         loopPending.setown(createOverflowableBuffer(this, LOOP_SMART_BUFFER_SIZE));
         loopPendingCount = 0;
         finishedLooping = ((container.getKind() == TAKloopcount) && (maxIterations == 0));