浏览代码

Avoid arithmetic overflow inside heaptrc unit on this test

git-svn-id: trunk@41883 -
pierre 6 年之前
父节点
当前提交
8ff0aaa369
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      tests/webtbs/tw17430.pp

+ 7 - 1
tests/webtbs/tw17430.pp

@@ -6,7 +6,13 @@ var
   p:pointer;
 begin
   returnnilifgrowheapfails:=true;
-  GetMem(p,ptruint(-128));
+  { Use a bigger absoulte value to avoid
+    getting a overflow inside heaptrc
+    if compiled with -gh option:
+    -128 changed to -1024,
+    which should be larger than typical
+    size of extra memory used by heaptrc }
+  GetMem(p,ptruint(-1024));
   if assigned(p) then
     halt(1);
 end.