aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/using/Simulation.rst2
-rw-r--r--src/grt/grt-lib.adb7
2 files changed, 7 insertions, 2 deletions
diff --git a/doc/using/Simulation.rst b/doc/using/Simulation.rst
index 6b6ea6a1a..ba31c8d5c 100644
--- a/doc/using/Simulation.rst
+++ b/doc/using/Simulation.rst
@@ -85,7 +85,7 @@ all options available, including the debugging one.
.. option:: --max-stack-alloc<=N>
Emit an error message in case of allocation on the stack of an
- object larger than `N` KB.
+ object larger than `N` KB. Use 0 to disable these checks.
.. option:: --sdf<=PATH=FILENAME>
diff --git a/src/grt/grt-lib.adb b/src/grt/grt-lib.adb
index 0bb9c2e36..26491a7ad 100644
--- a/src/grt/grt-lib.adb
+++ b/src/grt/grt-lib.adb
@@ -279,10 +279,15 @@ package body Grt.Lib is
is
Bt : Backtrace_Addrs;
begin
- if Size >= Max_Stack_Allocation then
+ if Max_Stack_Allocation = 0 then
+ return;
+ end if;
+ if Size > Max_Stack_Allocation then
Save_Backtrace (Bt, 1);
Error_S ("declaration of a too large object (");
Diag_C (Natural (Size / 1024));
+ Diag_C (" > --max-stack-alloc=");
+ Diag_C (Natural (Max_Stack_Allocation / 1024));
Diag_C (" KB)");
Error_E_Call_Stack (Bt);
end if;