[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30

From: Vibhav Pant
Subject: bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
Date: Tue, 14 Feb 2017 20:48:51 +0530

On Tue, Feb 14, 2017 at 6:31 PM, Vibhav Pant <address@hidden> wrote:
> Sorry about that, this seems to be caused by bytecomp.el not
> generating correct jump addresses for some tags in the jump table.
> I'll try pushing a fix ASAP.
> On Tue, Feb 14, 2017 at 12:20 PM, Tino Calancha <address@hidden> wrote:
>> Mark Oteiza <address@hidden> writes:
>>>>From -Q:
>>> 1. C-x C-f some/patch.diff RET
>>> 2. M-n
>>>   Error running timer: (error "Invalid byte opcode: op=0, ptr=30")
>>> In GNU Emacs (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll 
>>> bars)
>>>  of 2017-02-13 built on logos
>>> Repository revision: fffd4ffd747fe46bb7849a874e4ae265b6eda54e
>> it might be cause by the new switch byte-code
>> (commit 88549ec38e9bb30e338a9985d0de4e6263b40fb7)
>> Save the definition of `diff-refine-hunk'
>> in a file:
>> /tmp/diff-refine-hunk.el
>> I)
>>     M-: (load "/tmp/diff-refine-hunk.el") RET
>>     ;; `diff-hunk-next' works as expected, i.e. with auto refinement.
>> II)
>>     M-: (byte-compile-file "/tmp/diff-refine-hunk.el") RET
>>     M-: (load "/tmp/diff-refine-hunk.elc") RET
>>     ;; `diff-hunk-next' doesn't auto refine and it shows
>>     ;; error "Variable binding depth exceeds max-specpdl-size".
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> In GNU Emacs (x86_64-pc-linux-gnu, GTK+ Version 3.22.7)
>>  of 2017-02-14 built on calancha-pc
>> Repository revision: 31b4d9a13741caae2422636d4944212e702b19c3

Correction, this was because of the peephole optimizer not replacing
the old tag in jump tables while merging adjacent tags. The following
patch should fix this issue. Could you test this and see if there are
any other related problems?


Vibhav Pant

diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 38f5dcc993..c44cf71674 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1752,12 +1752,21 @@ byte-optimize-lapcode
  (setcdr tmp2 lap1)
  (setq tmp3 (cdr (memq tmp2 tmp3))))
        (setq lap (delq lap0 lap)
-     keep-going t))
+     keep-going t)
+               ;; replace references to tag in jump tables, if any
+               (dolist (table byte-compile-jump-tables)
+                 (catch 'break
+                   (maphash #'(lambda (value tag)
+                                (when (equal tag lap0)
+                                  (puthash value lap1 table)
+                                  (throw 'break nil)))
+                            table))))
       ;; unused-TAG: --> <deleted>
       ((and (eq 'TAG (car lap0))
     (not (rassq lap0 lap))
+                    ;; make sure this tag isn't used in a jump-table
                     (cl-loop for table in byte-compile-jump-tables
                              when (member lap0 (hash-table-values table))
                              return nil finally return t))

Attachment: fix-merged-tags.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]