GNU bug report logs -
#46670
28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode
Previous Next
Full log
View this message in rfc822 format
This was found by Anthony Cowley, who isolated the exact function in
lsp-mode that was misbehaving. I verified that I could reproduce this
findings, and then I removed surrounding context to obtain a minimized
testcase. If this fails to reproduce, it's entirely my fault.
Steps to reproduce:
1) Put this in minimized.el:
;;; -*- lexical-binding: t; -*-
(defun minimized--look-back (s)
(and (equal (buffer-substring-no-properties (- (point) (length s)) (point))
s)
s))
(defun minimized-go ()
(interactive)
(message (minimized--look-back ".")))
(provide 'minimized)
2) Type "." in a buffer and then run minimized-go with the point after
the period. This prints back "." in the minibuffer if the code's
interpreted but not if it's native-compiled.
Note that removing the "lexical-binding: t" line makes the bug not
reproduce. Replacing "(- (point) (length s))" by "(1- (point))" also
makes the bug disappear.
Best,
Mauricio
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.