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

Previous Next

Package: emacs;

Reported by: Andrea Corallo <akrl <at> sdf.org>

Date: Mon, 30 Nov 2020 19:57:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Corallo <akrl <at> sdf.org>
To: 44968 <at> debbugs.gnu.org
Cc: Gerry Agbobada <gerry <at> gagbo.net>
Subject: bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
Date: Mon, 30 Nov 2020 19:56:09 +0000
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"))

===========





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

Previous Next


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