summaryrefslogtreecommitdiff
path: root/docs/users_guide/debugging.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/debugging.rst')
-rw-r--r--docs/users_guide/debugging.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index 569923ade4..77bb7f0e2c 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -999,6 +999,18 @@ Checking for consistency
cases. This is helpful when debugging demand analysis or type checker bugs
which can sometimes manifest as segmentation faults.
+.. ghc-flag:: -fcheck-prim-bounds
+ :shortdesc: Instrument array primops with bounds checks.
+ :type: dynamic
+
+ Typically primops operations like ``writeArray#`` exhibit unsafe behavior,
+ relying on the user to perform any bounds checking. This flag instructs the
+ code generator to instrument such operations with bound checking logic
+ which aborts the program when an out-of-bounds access is detected.
+
+ Note that this is only intended to be used as a debugging measure, not as
+ the primary means of catching out-of-bounds accesses.
+
.. _checking-determinism:
Checking for determinism