diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-12-03 20:04:41 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-12-03 20:12:09 +0100 |
commit | 36b0b3d91179be364b45acd1527dde8a51553f51 (patch) | |
tree | 2c68703b3e9d02f5d009cda6e70e2a76ab163b8f | |
parent | 5bf6c7e02843956e2747589c78d96b9defeab32b (diff) | |
download | ghdl-36b0b3d91179be364b45acd1527dde8a51553f51.tar.gz ghdl-36b0b3d91179be364b45acd1527dde8a51553f51.tar.bz2 ghdl-36b0b3d91179be364b45acd1527dde8a51553f51.zip |
Improve help and doc for --max-stack-alloc.
-rw-r--r-- | doc/using/Simulation.rst | 2 | ||||
-rw-r--r-- | src/grt/grt-lib.adb | 7 |
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; |