[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace.
From: |
Maxime Devos |
Subject: |
Re: [PATCH] Avoid 'frame-local-ref' errors when printing backtrace. |
Date: |
Wed, 21 Sep 2022 12:50:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 |
On 20-09-2022 09:23, Andrew Whatson wrote:
=> (lambda (binding)
- (let ((val (frame-local-ref frame (binding-slot binding)
- (binding-representation binding))))
+ (let* ((slot (binding-slot binding))
+ ;; HACK: Avoid out-of-range from frame-local-ref.
+ ;; Some frames have bindings beyond nlocals. That
+ ;; is probably a bug somewhere else, but at least
+ ;; this workaround allows them to be printed.
+ (val (if (< slot nlocals)
+ (frame-local-ref frame slot
+ (binding-representation binding))
+ ;; else #<unspecified > +
)))
I propose to add a link to the bug report in the comments, for future
reference. Also, there is an interest in returning zero values in such
cases: <https://www.mail-archive.com/bug-guile@gnu.org/msg07927.html>
(that patch didn't work out, but the sentiment is still there).
As such, I recommend being explicit:
(if [...]
[...]
*unspecified*)
Greetings,
Maxime.
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature