unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30872: 26.0.91; odd byte compile issue
@ 2018-03-20  3:08 Aaron Jensen
  2018-03-20  5:41 ` Aaron Jensen
  2018-03-20 23:57 ` Noam Postavsky
  0 siblings, 2 replies; 9+ messages in thread
From: Aaron Jensen @ 2018-03-20  3:08 UTC (permalink / raw)
  To: 30872


Previously, in bug#30852 I noted that there was an infinite loop in
eterm-256color. It appears that that loop may be caused by some bug, or
something I do not understand in Emacs. I can repro this in 26 and 27

To repro, put this in test.el and byte compile it:

;;; -*- lexical-binding: t; -*-
(defun repro-bug (handle-fun &rest args)
  (pcase-let
      (((or
         `(,params)
         `(t ,_))
        args))
    (if t
        (progn
          (message "before: %S" params)
          (pcase params
            (`(38)
             (message "A")
             (setq params nil))
            (`(,x . ,_)
             (message "B")
             (setq params nil)))
          (message "after: %S" params)
          params)
      (apply handle-fun args))))

There's all sorts of weird stuff in that repro, and maybe someone can
pare it down further, but most of it appears to be required.

Then:

(load-file "test.elc")
(repro-bug nil '(0))

Expected:

It returns nil and prints:

before: (0)
B
after: nil
nil

Actual:

It returns (0) and prints:

before: (0)
B
after: (0)
(0)


Note that if the function is eval'd, it works as expected. The problem
only appears when byte compiled.


In GNU Emacs 26.0.91 (build 1, x86_64-apple-darwin17.4.0, NS appkit-1561.20 Version 10.13.3 (Build 17D102))
 of 2018-03-15 built on aaron-mbt.local
Repository revision: 2b8507fbdce8228ccdbcbc31fe545a50330ddd51
Windowing system distributor 'Apple', version 10.3.1561
Recent messages:
Saving file /Users/aaronjensen/Source/temp/test-a.el...
Wrote /Users/aaronjensen/Source/temp/test-a.el
Wrote /Users/aaronjensen/Source/temp/test-a.elc
Wrote /Users/aaronjensen/Source/temp/test-a.{el,elc}
Loading /Users/aaronjensen/Source/temp/test-a.elc...done
t
before: (0)
B
after: (0)
(0)

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-plus/HEAD-2b8507f --with-xml2
 --without-dbus --with-gnutls --with-imagemagick --with-modules
 --with-rsvg --with-ns --disable-ns-self-contained'

Configured features:
JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
NS MODULES THREADS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  magit-auto-revert-mode: t
  company-statistics-mode: t
  company-childframe-mode: t
  company-mode: t
  auto-compile-mode: t
  elisp-slime-nav-mode: t
  eros-mode: t
  lispyville-mode: t
  lispy-mode: t
  nameless-mode: t
  goto-address-prog-mode: t
  bug-reference-prog-mode: t
  auto-highlight-symbol-mode: t
  dtrt-indent-mode: t
  highlight-numbers-mode: t
  highlight-parentheses-mode: t
  rainbow-delimiters-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  auto-dim-other-buffers-mode: t
  recentf-mode: t
  global-git-gutter+-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  desktop-save-mode: t
  global-wakatime-mode: t
  wakatime-mode: t
  evil-mc-mode: t
  hl-todo-mode: t
  global-spacemacs-whitespace-cleanup-mode: t
  spacemacs-whitespace-cleanup-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  winum-mode: t
  winner-mode: t
  pupo-mode: t
  purpose-mode: t
  volatile-highlights-mode: t
  global-vi-tilde-fringe-mode: t
  vi-tilde-fringe-mode: t
  save-place-mode: t
  savehist-mode: t
  projectile-rails-global-mode: t
  projectile-mode: t
  persp-mode: t
  global-origami-mode: t
  origami-mode: t
  Info-breadcrumbs-in-mode-line-mode: t
  flycheck-pos-tip-mode: t
  global-flycheck-mode: t
  flx-ido-mode: t
  eyebrowse-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  global-evil-search-highlight-persist: t
  evil-search-highlight-persist: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  evil-lion-mode: t
  evil-escape-mode: t
  global-anzu-mode: t
  anzu-mode: t
  eval-sexp-fu-flash-mode: t
  editorconfig-mode: t
  diff-auto-refine-mode: t
  counsel-mode: t
  ivy-mode: t
  delete-selection-mode: t
  clean-aindent-mode: t
  hybrid-mode: t
  which-key-mode: t
  override-global-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  evil-mode: t
  evil-local-mode: t
  spacemacs-leader-override-mode: t
  global-spacemacs-leader-override-mode: t
  global-hl-line-mode: t
  xterm-mouse-mode: t
  global-auto-revert-mode: t
  shell-dirtrack-mode: t
  ido-vertical-mode: t
  global-page-break-lines-mode: t
  page-break-lines-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t
  hs-minor-mode: t

Load-path shadows:
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/ht-20180129.1434/ht hides /Users/aaronjensen/.emacs.d/core/libs/ht
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/inf-ruby-20180309.433/inf-ruby hides /usr/local/share/emacs/site-lisp/ruby/inf-ruby
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-stan hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-stan
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-exp hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-exp
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-J hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-J
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-eshell hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-eshell
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-emacs-lisp hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-emacs-lisp
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-gnus hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-gnus
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-css hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-css
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-lob hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-lob
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-forth hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-forth
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-macs hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-macs
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-version hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-version
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-scheme hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-scheme
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-abc hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-abc
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-C hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-C
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-capture hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-capture
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ref hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ref
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-clojure hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-clojure
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-mouse hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-mouse
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ledger hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ledger
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-ctags hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-ctags
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-entities hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-entities
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-archive hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-archive
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-screen hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-screen
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-haskell hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-haskell
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-asymptote hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-asymptote
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-mhe hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-mhe
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-table hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-table
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-keys hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-keys
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-org hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-org
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-plot hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-plot
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-awk hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-awk
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-groovy hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-groovy
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-octave hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-octave
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-faces hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-faces
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-colview hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-colview
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-R hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-R
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-timer hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-timer
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ebnf hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ebnf
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-mobile hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-mobile
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-fortran hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-fortran
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-shell hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-shell
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-perl hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-perl
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-sqlite hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-sqlite
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-sed hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-sed
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-list hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-list
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ruby hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ruby
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-eval hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-eval
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-habit hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-habit
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-clock hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-clock
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-html hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-html
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-src hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-src
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-lisp hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-lisp
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ditaa hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ditaa
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-pcomplete hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-pcomplete
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-lint hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-lint
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-rmail hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-rmail
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-latex hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-latex
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-sass hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-sass
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-io hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-io
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-tangle hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-tangle
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-calc hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-calc
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-java hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-java
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-icalendar hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-icalendar
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-eww hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-eww
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-md hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-md
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-beamer hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-beamer
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-element hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-element
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-protocol hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-protocol
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-mscgen hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-mscgen
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-gnuplot hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-gnuplot
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-latex hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-latex
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-id hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-id
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-vala hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-vala
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-man hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-man
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-feed hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-feed
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-lua hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-lua
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-table hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-table
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-ocaml hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-ocaml
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-coq hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-coq
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-picolisp hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-picolisp
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-indent hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-indent
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-lilypond hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-lilypond
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-matlab hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-matlab
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-datetree hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-datetree
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-python hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-python
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-bbdb hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-bbdb
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-makefile hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-makefile
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-duration hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-duration
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-agenda hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-agenda
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-dot hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-dot
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-js hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-js
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-publish hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-publish
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-inlinetask hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-inlinetask
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-org hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-org
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-core hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-core
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-compat hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-compat
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-docview hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-docview
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-odt hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-odt
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-plantuml hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-plantuml
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-ascii hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-ascii
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-loaddefs hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-loaddefs
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-w3m hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-w3m
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-bibtex hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-bibtex
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-info hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-info
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-hledger hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-hledger
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-maxima hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-maxima
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-macro hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-macro
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-sql hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-sql
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-attach hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-attach
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-processing hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-processing
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ox-texinfo hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ox-texinfo
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-irc hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-irc
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-crypt hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-crypt
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-footnote hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-footnote
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/org-install hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/org-install
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-comint hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-comint
/Users/aaronjensen/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180312/ob-shen hides /usr/local/Cellar/emacs-plus/HEAD-2b8507f/share/emacs/26.0.91/lisp/org/ob-shen

Features:
(shadow sort mail-extr emacsbug sendmail tabify cl-print debug tramp-sh
magit-bookmark bookmark smex evil-nerd-commenter
evil-nerd-commenter-operator evil-nerd-commenter-sdk eterm-256color
shell-pop term ehelp company-tng misearch multi-isearch eieio-opt
speedbar sb-image ezimage dframe appt diary-lib diary-loaddefs
org-duration epa-file org-agenda pp executable company-emoji
company-emoji-list org-eldoc evil-org org-table ob-shell ob-ruby
org-bullets org-download toc-org typo org-indent image-file org-rmail
org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader org-docview
doc-view jka-compr org-bibtex bibtex org-bbdb org-w3m org-checklist
org-inlinetask org-gcal org-archive smartparens-org ob-elixir ob-http
ob-http-mode ob-restclient restclient ox-gfm ox-md ox-reveal ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table
ox-ascii ox-publish ox orgit org-element avl-tree generator magithub
magithub-dash magithub-notification magithub-issue-view magithub-comment
magithub-repo magithub-orgs magithub-issue-tricks magithub-issue-post
magithub-edit-mode magithub-ci magithub-issue magithub-label
magithub-user magithub-core magithub-faces magithub-settings
smartparens-markdown markdown-mode ghub+ apiwrap apropos evil-magit
git-rebase magit-gh-pulls gh gh-users gh-issues gh-pulls gh-repos
gh-comments gh-gist gh-oauth gh-api logito gh-cache gh-auth gh-url
gh-profile magit-obsolete magit-blame magit-stash magit-bisect
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-collab ghub
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert
magit-process magit-margin magit-mode org org-macro org-footnote
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint
ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar
cal-loaddefs request-deferred deferred request alert log4e notifications
dbus xml gntp shrink-path vc-git open-junk-file company-statistics
company-files company-keywords company-dabbrev-code company-dabbrev
company-capf company-childframe posframe company overseer pkg-info
url-http tls gnutls url url-proxy url-privacy url-expand url-methods
url-history mailcap url-auth url-cookie url-domsuf url-util url-gw nsm
epl auto-compile packed elisp-slime-nav eros flycheck-package
package-lint finder lispyville lispy iedit iedit-lib
multiple-cursors-core lispy-inline avy semantic/db semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
cedet evil-ediff ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff edebug lispy-tags nameless goto-addr
bug-reference auto-highlight-symbol dtrt-indent highlight-numbers
parent-mode highlight-parentheses hideshow rainbow-delimiters
yasnippet-snippets yasnippet elec-pair editorconfig-core
editorconfig-core-handle editorconfig-fnmatch colir face-remap
auto-dim-other-buffers recentf tree-widget git-gutter-fringe+
fringe-helper git-gutter+ git-commit with-editor magit-git magit-section
magit-utils crm magit-popup async-bytecomp async log-edit message rmc
puny rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log desktop frameset
wakatime-mode contextual-menubar quiet-emacs fill-or-unfill
init-macos-terminal-copy-paste init-terminal-cursor
evil-terminal-cursor-changer init-org init-magit evil-mc
evil-mc-command-execute evil-mc-command-record evil-mc-cursor-make
evil-mc-region evil-mc-cursor-state evil-mc-undo evil-mc-vars
evil-mc-known-commands evil-mc-common hl-todo persistent-soft list-utils
pcache eieio-base font-utils server zone xterm-color
spacemacs-whitespace-cleanup ws-butler winum winner
spacemacs-purpose-popwin window-purpose-x imenu-list imenu
window-purpose window-purpose-fixes window-purpose-prefix-overload
window-purpose-switch window-purpose-layout window-purpose-core
window-purpose-configuration window-purpose-utils volatile-highlights
vi-tilde-fringe unicode-fonts tmux string-inflection smartparens-config
smartparens-text smartparens-ruby saveplace savehist ruby-test-mode
pcre2el rxt re-builder projectile-rails rake f inflections inf-ruby
ruby-mode smie projectile grep ibuf-ext ibuffer ibuffer-loaddefs popwin
persp-mode osx-trash origami origami-parsers s linum ivy-hydra info+
image-mode google-c-style flycheck-pos-tip pos-tip flycheck find-func
flx-ido eyebrowse evil-surround evil-search-highlight-persist
evil-numbers evil-lisp-state smartparens dash evil-lion evil-indent-plus
evil-exchange evil-escape evil-args evil-anzu anzu eval-sexp-fu
highlight font-lock+ frame-fns avoid editorconfig noutline outline
doom-modeline let-alist powerline-separators color all-the-icons
all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons memoize diff-hl vc-dir ewoc
vc vc-dispatcher diff-mode counsel dired dired-loaddefs compile esh-util
etags xref project swiper ivy flx delsel ivy-overlay ffap
clean-aindent-mode adaptive-wrap gh-common marshal rx docker-tramp
tramp-cache hybrid-mode evil-evilified-state which-key use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core hydra lv
exec-path-from-shell cus-edit cus-start cus-load evil evil-integration
undo-tree diff evil-maps evil-commands reveal flyspell ispell evil-jumps
evil-command-window evil-types evil-search evil-ex evil-macros
evil-repeat evil-states evil-core evil-common windmove thingatpt rect
evil-digraphs diminish evil-vars bind-map quelpa help-fns radix-tree
package-build mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr json map lisp-mnt hl-line xt-mouse
autorevert filenotify cl-extra disp-table wid-edit monokai-theme info
finder-inf patch-server init-sass init-php init-html init-evil tramp
tramp-compat tramp-loaddefs trampver shell pcomplete comint ansi-color
ring parse-time format-spec ido-vertical-mode ido core-spacemacs
core-use-package-ext core-transient-state core-micro-state core-toggle
core-keybindings core-fonts-support core-themes-support
core-display-init core-jump core-release-management core-custom-settings
core-configuration-layer eieio-compat core-spacemacs-buffer core-funcs
core-dotspacemacs ht cl help-mode warnings package url-handlers
url-parse auth-source cl-seq password-cache url-vars seq eieio byte-opt
bytecomp byte-compile cconv eieio-core eieio-loaddefs epg epg-config
core-command-line pcase core-debug edmacro kmacro derived cl-macs gv
advice profiler easymenu cl-loaddefs cl-lib page-break-lines easy-mmode
core-emacs-backports subr-x time-date tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 1610503 457352)
 (symbols 48 87585 1)
 (miscs 40 2934 6745)
 (strings 32 347460 50549)
 (string-bytes 1 11857161)
 (vectors 16 153761)
 (vector-slots 8 3562242 217408)
 (floats 8 1081 1701)
 (intervals 56 41136 3898)
 (buffers 992 140))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: 26.0.91; odd byte compile issue
  2018-03-20  3:08 bug#30872: 26.0.91; odd byte compile issue Aaron Jensen
@ 2018-03-20  5:41 ` Aaron Jensen
  2018-03-20 23:57 ` Noam Postavsky
  1 sibling, 0 replies; 9+ messages in thread
From: Aaron Jensen @ 2018-03-20  5:41 UTC (permalink / raw)
  To: 30872

I realized I left it for the reader to figure out what the issue is.
It appears that using a certain combination of macros, when a file is
byte compiled, that version does not allow you to `setq' a variable
that has been defined by `pcase-let' in an `or'.

The repro demonstrates this by doing a `(setq params nil)' and then
printing the value of params and returning it. It is not set to `nil'
even though that line has been evaluated.

Hope that helps.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: 26.0.91; odd byte compile issue
  2018-03-20  3:08 bug#30872: 26.0.91; odd byte compile issue Aaron Jensen
  2018-03-20  5:41 ` Aaron Jensen
@ 2018-03-20 23:57 ` Noam Postavsky
  2018-05-30 22:55   ` bug#30872: incorrect byte-compile of closure called from local funcalled function Noam Postavsky
  1 sibling, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-03-20 23:57 UTC (permalink / raw)
  To: Aaron Jensen; +Cc: 30872

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

retitle 30872 incorrect byte-compile of closure called from local funcalled function
found 30872 24.3
tags 30872 + confirmed
quit

Aaron Jensen <aaronjensen@gmail.com> writes:

> There's all sorts of weird stuff in that repro, and maybe someone can
> pare it down further, but most of it appears to be required.

I macroexpanded and reduced the result, ending up with this:


[-- Attachment #2: reduced test case --]
[-- Type: application/emacs-lisp, Size: 342 bytes --]

[-- Attachment #3: Type: text/plain, Size: 191 bytes --]


I can reproduce back to 24.3 (which is the earliest Emacs I have
running).  I expect the bug has been present since the introduction of
lexical scope.  Looks somewhat similar to Bug#24171.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-03-20 23:57 ` Noam Postavsky
@ 2018-05-30 22:55   ` Noam Postavsky
  2018-06-08  0:33     ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-05-30 22:55 UTC (permalink / raw)
  To: Aaron Jensen; +Cc: Stefan Monnier, 30872


I narrowed it down a bit more, note the lack of setq in the result of
byte-compile-preprocess:

(byte-compile-preprocess
 '#'(lambda (handle-fun arg)
      (let* ((subfun #'(lambda (params)
                         (ignore handle-fun)
                         (funcall #'(lambda () (setq params nil)))
                         params)))
        (funcall subfun arg))))
;=>
#'(lambda (handle-fun arg)
    (let* ((subfun
            #'(lambda (handle-fun params)
                (ignore handle-fun)
                (funcall
                 (internal-make-closure nil
                                        (params)
                                        nil nil))
                params)))
      (funcall subfun handle-fun arg)))

It's hitting this bit of code in cconv.el, where it says this "should
never happen":

(defun cconv-convert (form env extend)
  (pcase form
    [...]
    (`(setq . ,forms)                   ; setq special form
      [...]
             (push (pcase sym-new
                     ((pred symbolp) `(setq ,sym-new ,value))
                     (`(car-safe ,iexp) `(setcar ,iexp ,value))
                     ;; This "should never happen", but for variables which are
                     ;; mutated+captured+unused, we may end up trying to `setq'
                     ;; on a closed-over variable, so just drop the setq.
                     (_ ;; (byte-compile-report-error
                      ;;  (format "Internal error in cconv of (setq %s ..)"
                      ;;          sym-new))
                      value))

Stefan, thoughts?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-05-30 22:55   ` bug#30872: incorrect byte-compile of closure called from local funcalled function Noam Postavsky
@ 2018-06-08  0:33     ` Noam Postavsky
  2018-06-08  2:43       ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-06-08  0:33 UTC (permalink / raw)
  To: Aaron Jensen; +Cc: Stefan Monnier, 30872

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

Okay, I think I found the problem.  In case of a lambda lifted function
we weren't doing this part of cconv--convert-function:

    (dolist (arg args)
      (if (not (member (cons (list arg) parentform) cconv-captured+mutated))
          (if (assq arg new-env) (push `(,arg) new-env))
        (push `(,arg . (car-safe ,arg)) new-env)
        (push `(,arg (list ,arg)) letbind)))

so `params' wasn't handled properly.  I copied and adapted that code to
the corresponding place in cconv-convert, and it seems to work.  Please
review for sanity.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2611 bytes --]

From dbdfb6c0b2bfa497178afcede7a8d0bbde4a00d7 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 7 Jun 2018 19:58:47 -0400
Subject: [PATCH v1] Don't forget to analyse args of lambda lifted functions
 (Bug#30872)

* lisp/emacs-lisp/cconv.el (cconv-convert): Do the
(defun foo (... m-arg ...) ...) => (defun foo (... m-arg
...) (let ((m-arg (list m-arg))) ...)) transformation for mutated args
of lambda lifted functions as well.
---
 lisp/emacs-lisp/cconv.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 02fe794467..e6e877846f 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -352,18 +352,25 @@ cconv-convert
                           (funargs (cadr fun))
                           (funcvars (append fvs funargs))
                           (funcbody (cddr fun))
-                          (funcbody-env ()))
+                          (funcbody-env ())
+                          (letbind ()))
                      (push `(,var . (apply-partially ,var . ,fvs)) new-env)
                      (dolist (fv fvs)
                        (cl-pushnew fv new-extend)
                        (if (and (eq 'car-safe (car-safe (cdr (assq fv env))))
                                 (not (memq fv funargs)))
                            (push `(,fv . (car-safe ,fv)) funcbody-env)))
-                     `(function (lambda ,funcvars .
-                                  ,(mapcar (lambda (form)
-                                             (cconv-convert
-                                              form funcbody-env nil))
-                                           funcbody)))))
+                     (dolist (arg funargs)
+                       (if (not (member (cons (list arg) value) cconv-captured+mutated))
+                           (if (assq arg funcbody-env) (push `(,arg) funcbody-env))
+                         (push `(,arg . (car-safe ,arg)) funcbody-env)
+                         (push `(,arg (list ,arg)) letbind)))
+                     `(function (lambda ,funcvars
+                                  (let ,letbind .
+                                       ,(mapcar (lambda (form)
+                                                  (cconv-convert
+                                                   form funcbody-env nil))
+                                                funcbody))))))
 
                   ;; Check if it needs to be turned into a "ref-cell".
                   ((member (cons binder form) cconv-captured+mutated)
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-06-08  0:33     ` Noam Postavsky
@ 2018-06-08  2:43       ` Stefan Monnier
  2018-06-11 12:36         ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2018-06-08  2:43 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Aaron Jensen, 30872

> so `params' wasn't handled properly.  I copied and adapted that code to
> the corresponding place in cconv-convert, and it seems to work.  Please
> review for sanity.

Looks sane, thank you.  Even better would be to try and share this code
rather than duplicate it.  Please try and add some comment in the code,
tho: it's rather dry (and yes, I know I'm largely to blame for it).

Also don't forget to add a corresponding testcase.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-06-08  2:43       ` Stefan Monnier
@ 2018-06-11 12:36         ` Noam Postavsky
  2018-06-11 15:29           ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-06-11 12:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Aaron Jensen, 30872

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

tags 30872 + patch
quit

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> Looks sane, thank you.  Even better would be to try and share this code
> rather than duplicate it.  Please try and add some comment in the code,
> tho: it's rather dry (and yes, I know I'm largely to blame for it).

It seemed pretty okay to me; I was confused by the

    (if (assq arg env) (push `(,arg) env))

for a bit, so I added a mention of the nil case to the cconv-convert
docstring.

> Also don't forget to add a corresponding testcase.

Right, here it is.  Should this go to emacs-26?  It looks fairly safe to
me, but since I'm new to this code, I don't want to put too much weight
on my assessment.


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 6843 bytes --]

From 7458c4dc8f49f3a2e1d35eb0eda4da5b1c832487 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 7 Jun 2018 19:58:47 -0400
Subject: [PATCH] Don't forget to analyse args of lambda lifted functions
 (Bug#30872)

* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function.
(cconv--convert-function): Extracted from here.
(cconv-convert): Also use it here, in the lambda lifted case, so that
mutated args are properly accounted for.
* test/lisp/emacs-lisp/cconv-tests.el: New test.
---
 lisp/emacs-lisp/cconv.el            | 55 +++++++++++++++++++++----------------
 test/lisp/emacs-lisp/cconv-tests.el | 40 +++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 24 deletions(-)
 create mode 100644 test/lisp/emacs-lisp/cconv-tests.el

diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 02fe794467..ff4e59ef1b 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -206,7 +206,6 @@ cconv--convert-function
   (cl-assert (equal body (caar cconv-freevars-alist)))
   (let* ((fvs (cdr (pop cconv-freevars-alist)))
          (body-new '())
-         (letbind '())
          (envector ())
          (i 0)
          (new-env ()))
@@ -227,25 +226,8 @@ cconv--convert-function
     (setq envector (nreverse envector))
     (setq new-env (nreverse new-env))
 
-    (dolist (arg args)
-      (if (not (member (cons (list arg) parentform) cconv-captured+mutated))
-          (if (assq arg new-env) (push `(,arg) new-env))
-        (push `(,arg . (car-safe ,arg)) new-env)
-        (push `(,arg (list ,arg)) letbind)))
-
-    (setq body-new (mapcar (lambda (form)
-                             (cconv-convert form new-env nil))
-                           body))
-
-    (when letbind
-      (let ((special-forms '()))
-        ;; Keep special forms at the beginning of the body.
-        (while (or (stringp (car body-new)) ;docstring.
-                   (memq (car-safe (car body-new)) '(interactive declare)))
-          (push (pop body-new) special-forms))
-        (setq body-new
-              `(,@(nreverse special-forms) (let ,letbind . ,body-new)))))
-
+    (setq body-new (cconv--convert-funcbody
+                     args body new-env parentform))
     (cond
      ((not (or envector docstring))     ;If no freevars - do nothing.
       `(function (lambda ,args . ,body-new)))
@@ -279,6 +261,30 @@ cconv--remap-llv
                           (nthcdr 3 mapping)))))
           new-env))
 
+(defun cconv--convert-funcbody (funargs funcbody env parentform)
+  "Run `cconv-convert' on FUNCBODY, the forms of a lambda expression.
+PARENTFORM is the form containing the lambda expression.  ENV is a
+lexical environment (same format as for `cconv-convert'), not
+including FUNARGS, the function's argument list.  Return a list
+of converted forms."
+  (let ((letbind ()))
+    (dolist (arg funargs)
+      (if (not (member (cons (list arg) parentform) cconv-captured+mutated))
+          (if (assq arg env) (push `(,arg . nil) env))
+        (push `(,arg . (car-safe ,arg)) env)
+        (push `(,arg (list ,arg)) letbind)))
+    (setq funcbody (mapcar (lambda (form)
+                             (cconv-convert form env nil))
+                           funcbody))
+    (if letbind
+        (let ((special-forms '()))
+          ;; Keep special forms at the beginning of the body.
+          (while (or (stringp (car funcbody)) ;docstring.
+                     (memq (car-safe (car funcbody)) '(interactive declare)))
+            (push (pop funcbody) special-forms))
+          `(,@(nreverse special-forms) (let ,letbind . ,funcbody)))
+      funcbody)))
+
 (defun cconv-convert (form env extend)
   ;; This function actually rewrites the tree.
   "Return FORM with all its lambdas changed so they are closed.
@@ -292,6 +298,9 @@ cconv-convert
     environment's Nth slot.
  (VAR . (apply-partially F ARG1 ARG2 ..)): VAR has been λ-lifted and takes
     additional arguments ARGs.
+ (VAR . nil): VAR is accessed normally.  This is the same as VAR
+    being absent from ENV, but an explicit nil entry is useful
+    for shadowing VAR for a specific scope.
 EXTEND is a list of variables which might need to be accessed even from places
 where they are shadowed, because some part of ENV causes them to be used at
 places where they originally did not directly appear."
@@ -360,10 +369,8 @@ cconv-convert
                                 (not (memq fv funargs)))
                            (push `(,fv . (car-safe ,fv)) funcbody-env)))
                      `(function (lambda ,funcvars .
-                                  ,(mapcar (lambda (form)
-                                             (cconv-convert
-                                              form funcbody-env nil))
-                                           funcbody)))))
+                                  ,(cconv--convert-funcbody
+                                    funargs funcbody funcbody-env value)))))
 
                   ;; Check if it needs to be turned into a "ref-cell".
                   ((member (cons binder form) cconv-captured+mutated)
diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el
new file mode 100644
index 0000000000..d14847ce45
--- /dev/null
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -0,0 +1,40 @@
+;;; cconv-tests.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+(require 'ert)
+
+(ert-deftest cconv-convert-lambda-lifted ()
+  "Bug#30872."
+  (should
+   (equal (funcall
+           (byte-compile
+            '#'(lambda (handle-fun arg)
+                 (let* ((subfun
+                         #'(lambda (params)
+                             (ignore handle-fun)
+                             (funcall #'(lambda () (setq params 42)))
+                             params)))
+                   (funcall subfun arg))))
+           nil 99)
+          42)))
+
+(provide 'cconv-tests)
+;; cconv-tests.el ends here.
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-06-11 12:36         ` Noam Postavsky
@ 2018-06-11 15:29           ` Stefan Monnier
  2018-06-16 22:37             ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2018-06-11 15:29 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Aaron Jensen, 30872

>> Also don't forget to add a corresponding testcase.
> Right, here it is.

Thanks

> Should this go to emacs-26?
> It looks fairly safe to me, but since I'm new to this code, I don't
> want to put too much weight on my assessment.

Not sure how much testing the Emacs-26.2 release will go through, so
unless there's some urgency I would recommend to keep it on master, just
to be on the safe side.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#30872: incorrect byte-compile of closure called from local funcalled function
  2018-06-11 15:29           ` Stefan Monnier
@ 2018-06-16 22:37             ` Noam Postavsky
  0 siblings, 0 replies; 9+ messages in thread
From: Noam Postavsky @ 2018-06-16 22:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Aaron Jensen, 30872

tags 30872 fixed
close 30872 27.1
quit

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> Not sure how much testing the Emacs-26.2 release will go through, so
> unless there's some urgency I would recommend to keep it on master, just
> to be on the safe side.

Pushed to master.

[1: 6021e1db92]: 2018-06-16 18:34:19 -0400
  Don't forget to analyze args of lambda lifted functions (Bug#30872)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6021e1db92e355fbf5c66765fb0bc4658a80180a





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-16 22:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-20  3:08 bug#30872: 26.0.91; odd byte compile issue Aaron Jensen
2018-03-20  5:41 ` Aaron Jensen
2018-03-20 23:57 ` Noam Postavsky
2018-05-30 22:55   ` bug#30872: incorrect byte-compile of closure called from local funcalled function Noam Postavsky
2018-06-08  0:33     ` Noam Postavsky
2018-06-08  2:43       ` Stefan Monnier
2018-06-11 12:36         ` Noam Postavsky
2018-06-11 15:29           ` Stefan Monnier
2018-06-16 22:37             ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).