~ chicken-core (chicken-5) c9e5d2efc34dda994d5f6b93415359c72083fdfe


commit c9e5d2efc34dda994d5f6b93415359c72083fdfe
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Fri Jun 30 09:42:48 2023 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Jul 3 12:00:07 2023 +0200

    Fix thread id extraction in get-call-chain
    
    This was missed when changing the trace buffer struct; all accessors
    had to be adjusted by adding one to the index, except for the "raw"
    slot.
    
    Without it, the filtering of call chain entries for the current thread
    will fail for anything with "frameinfo" / a filled cooked2 slot, so
    the call chain will be a lot smaller than it ought to be.
    
    Signed-off-by: felix <felix@call-with-current-continuation.org>

diff --git a/library.scm b/library.scm
index 94f304b8..b04b330a 100644
--- a/library.scm
+++ b/library.scm
@@ -4975,7 +4975,7 @@ EOF
 	(let loop ((i 0))
 	  (if (fx>= i n)
 	      '()
-	      (let ((t (##sys#slot vec (fx+ i 3)))) ; thread id
+	      (let ((t (##sys#slot vec (fx+ i 4)))) ; thread id
 		(if (or (not t) (not thread) (eq? t-id t))
 		    (cons (vector
 			   (or (##sys#slot vec (fx+ i 1)) ; cooked_location
Trap