]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example.
authorAndrea Corallo <acorallo@gnu.org>
Wed, 20 Mar 2024 13:49:28 +0000 (14:49 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:13:59 +0000 (15:13 +0100)
(cherry picked from commit e2fec514fd22e61c2a4e9343056aa744e93203a1)

lisp/emacs-lisp/comp.el

index d78305977091793a6e67753e891d30b17c828b03..7e8d4e15e0a5dbf1c322fa9b0ace5c6431cee1e9 100644 (file)
@@ -3017,6 +3017,18 @@ These are substituted with a normal `set' op."
 ;; the variable tested by the conditional branch is of the predicted
 ;; value type and signal an error otherwise.
 
+;;; Example:
+;; Assuming we want to compile 'test.el' and test function `foo' defined
+;; into it.
+
+;; Native compile 'test.el' instrumenting it for sanitizer usage.
+;; (let ((comp-sanitizer-emit t))
+;;   (load (native-compile "test.el")))
+
+;; Run `foo' with the sanitizer active.
+;; (let ((comp-sanitizer-active t))
+;;   (foo))
+
 (defvar comp-sanitizer-emit nil
   "Gates the sanitizer pass.
 This is intended to be used only for development and verification of