From 63e4ed1c8f1c5bbf59c366134d379bae972201f9 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Tue, 18 May 2021 18:43:11 +0200 Subject: [PATCH] Recreate symptom of Bug#42701. The fix to Bug#48489 (commit 9676d41b8301b84e07717e633059a3f2b5c4c9d8) has masked the symptom of Bug#42701 for 'if-let'. Create a helper macro that still exemplifies the bug. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests--duplicate-symbol-backtrack): New helper macro. (edebug-tests-duplicate-symbol-backtrack): Use it instead of 'if-let'. --- test/lisp/emacs-lisp/edebug-tests.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 7d45432e57e..2f45050e2eb 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -1029,14 +1029,21 @@ clashes (Bug#41853)." inner@cl-flet@10002 edebug-tests-cl-flet-2))))))) +(defmacro edebug-tests--duplicate-symbol-backtrack (arg) + "Helper macro that exemplifies Bug#42701. +ARG is either (FORM) or (FORM IGNORED)." + (declare (debug ([&or (form) (form sexp)]))) + (car arg)) + (ert-deftest edebug-tests-duplicate-symbol-backtrack () "Check that Edebug doesn't create duplicate symbols when backtracking (Bug#42701)." (with-temp-buffer - (dolist (form '((require 'subr-x) - (defun edebug-tests-duplicate-symbol-backtrack () - (if-let (x (funcall (lambda (y) 1) 2)) 3 4)))) - (print form (current-buffer))) + (print '(defun edebug-tests-duplicate-symbol-backtrack () + (edebug-tests--duplicate-symbol-backtrack + ;; Passing (FORM IGNORED) forces backtracking. + ((lambda () 123) ignored))) + (current-buffer)) (let* ((edebug-all-defs t) (edebug-initial-mode 'Go-nonstop) (instrumented-names ()) -- 2.39.5