GNU bug report logs - #28725
26.0.60; Error when using Edebug on a generator

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Fri, 6 Oct 2017 19:21:01 UTC

Severity: normal

Tags: confirmed

Merged with 40434

Found in versions 26.0.60, 27.0.90

Full log


Message #19 received at 28725 <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 28725 <at> debbugs.gnu.org
Subject: Re: bug#28725: 26.0.60; Error when using Edebug on a generator
Date: Mon, 21 Oct 2019 09:29:04 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm able to reproduce this bug in Emacs 27.
>
> Does anybody know what's causing this?  It's bugging out in the
> `iter-yield' call.

I took a look and I think the problem is that cps--transform-1 doesn't
look inside lambda forms.  When Edebug instruments a function, it wraps
the body of the function in a lambda form.

Here's a code sample to reproduce the bug with just eval-buffer, no
Edebug necessary:

;;;  -*- lexical-binding: t -*-

(require 'generator)

(iter-defun mycounter (start)
  (let ((i 0)
	(offset-yield-func (lambda (x) (iter-yield (+ x start)))))
    (while t
      (funcall offset-yield-func i)
      (setq i (1+ i)))))

(defun my-iter-do ()
  (let (results
	(tally (mycounter 10)))
    (dotimes (_ 4)
      (push (iter-next tally) results))
    results))

(my-iter-do)





This bug report was last modified 4 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.