Переглянути джерело

* New test to catch stack overflow in compiler (#40010)

J. Gareth "Curious Kit" Moreton 2 роки тому
батько
коміт
f54917d600
1 змінених файлів з 13 додано та 0 видалено
  1. 13 0
      tests/webtbf/tw40010.pp

+ 13 - 0
tests/webtbf/tw40010.pp

@@ -0,0 +1,13 @@
+{ %FAIL }
+
+program tw40010;
+
+type
+  PA_Node = ^TA_Node;
+  TA_Node = array[0..3] of PA_Node;
+
+  var n1,n2:PA_Node;
+begin
+  n2 := nil;
+  n1[3] := n2; { Should fail with a syntax error, not not cause a stack overflow }
+end.