Subject: bug#44968: closed (Re: bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list')

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 01 Dec 2020 13:17:02 +0000

Your bug report

#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
44968: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44968
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
From: Andrea Corallo <[email-masked]>
To: "Gerry Agbobada" <[email-masked]>
Cc: [email-masked]
Date: Tue, 01 Dec 2020 13:16:10 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

"Gerry Agbobada" <[email-masked]> writes:

> On Tue, Dec 1, 2020, at 10:14, Andrea Corallo wrote:
>
>  (call car #s(comp-mvar (cons) (nil) nil 15178090 6))
>
> Hello,
>
> I see, thanks for the explanation and the quick fix :) (I tested today and the commit works well)

Thanks for checking, closing then.

Andrea

Subject: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
From: Andrea Corallo <[email-masked]>
To: [email-masked]
Cc: Gerry Agbobada <[email-masked]>
Date: Mon, 30 Nov 2020 19:56:09 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Reported by Gerry Agbobada,

reproducer:

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

(defun rustic-flycheck-dirs-list (start end)
  "Return a list of directories from START (inclusive) to END (exclusive).
E.g., if START is '/a/b/c/d' and END is '/a', return the list
'(/a/b/c/d /a/b/c /a/b) in this order.
START and END are strings representing file paths.  END should be
above START in the file hierarchy; if not, the list stops at the
root of the file hierarchy."
  (let ((dirlist)
        (dir (expand-file-name start))
        (end (expand-file-name end)))
    (while (not (or (equal dir (car dirlist)) ; avoid infinite loop
                    (file-equal-p dir end)))
      (push dir dirlist)
      (setq dir (directory-file-name (file-name-directory dir))))
    (nreverse dirlist)))

(native-compile #'rustic-flycheck-dirs-list)

(message "%s" (rustic-flycheck-dirs-list "/tmp/test/foo" "/tmp"))

===========