Skip to content

Commit

Permalink
Find the stackframe marker in interpreted-function objects
Browse files Browse the repository at this point in the history
interpreted-function objects (introduced in Emacs 30) are not lists,
and were not checked by the inner function tree-find in
buttercup--backtrace.  Check for buttercup--thunk Oclosures and check
the code.
  • Loading branch information
snogge committed Jul 18, 2024
1 parent c0e4d17 commit dfbef21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -2131,18 +2131,24 @@ ARGS according to `debugger'."
(setq in-program-stack t))
;; keep frames until one of the known functions are found, after
;; this is just the buttercup framework and not interesting for
;; users incorrect for testing buttercup. Some frames before the
;; users (incorrect for testing buttercup). Some frames before the
;; function also have to be discarded
(cl-labels ((tree-find (key tree)
(cl-block tree-find
(while (consp tree)
(let ((elem (pop tree)))
(when (or (and (consp elem)
(tree-find key elem))
(and (buttercup--thunk-p elem)
(tree-find key (aref elem 1)))
(eql key elem))
(cl-return-from tree-find t))))
(cl-return-from tree-find
(and tree (eql tree key))))))
;; TODO: Only check the cadr of frame, that is where the function is.
;; The buttercup--mark-stackframe should only be in wrapped expressions,
;; optimize by checking if it is a wrapped expression?
;; Will we even need the marker if we can check that?
(when (and in-program-stack (tree-find 'buttercup--mark-stackframe frame))
(pop frame-list)
(cl-return frame-list)))))
Expand Down

0 comments on commit dfbef21

Please sign in to comment.