From: Andrea Corallo Date: Wed, 20 Mar 2024 13:49:28 +0000 (+0100) Subject: ; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=05a1342c26e7fe1e57f5f426f3819cba3dc8d408;p=emacs.git ; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example. (cherry picked from commit e2fec514fd22e61c2a4e9343056aa744e93203a1) --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index d7830597709..7e8d4e15e0a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -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