1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Fix trap handlers to handle applicable structs.

Reported by Jordy Dickinson <jordy.dickinson@gmail.com>.
Fixes <http://bugs.gnu.org/15691>.

* module/system/vm/traps.scm (frame-matcher): Extract procedure when
  proc is an applicable struct.
This commit is contained in:
Ian Price 2013-10-24 05:51:47 +01:00
parent 793e8a9317
commit 306cc01d39

View file

@ -109,15 +109,18 @@
((new-disabled-trap vm enable disable) frame))
(define (frame-matcher proc match-objcode?)
(if match-objcode?
(lambda (frame)
(let ((frame-proc (frame-procedure frame)))
(or (eq? frame-proc proc)
(and (program? frame-proc)
(eq? (program-objcode frame-proc)
(program-objcode proc))))))
(lambda (frame)
(eq? (frame-procedure frame) proc))))
(let ((proc (if (struct? proc)
(procedure proc)
proc)))
(if match-objcode?
(lambda (frame)
(let ((frame-proc (frame-procedure frame)))
(or (eq? frame-proc proc)
(and (program? frame-proc)
(eq? (program-objcode frame-proc)
(program-objcode proc))))))
(lambda (frame)
(eq? (frame-procedure frame) proc)))))
;; A basic trap, fires when a procedure is called.
;;