From 5c14d481ac0def0d81f67456a648502d89de5a06 Mon Sep 17 00:00:00 2001
From: Ludovic Courtès
Date: Tue, 24 Mar 2009 23:05:56 +0100
Subject: Robustify `invocation-location'.

* src/guile/skribilo/location.scm (invocation-location): Make sure DEPTH
  is not above STACK's length.
---
 src/guile/skribilo/location.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/guile/skribilo/location.scm b/src/guile/skribilo/location.scm
index 47f72b7..5b50d63 100644
--- a/src/guile/skribilo/location.scm
+++ b/src/guile/skribilo/location.scm
@@ -1,7 +1,7 @@
 ;;; location.scm -- Skribilo source location.
 ;;;
+;;; Copyright 2005, 2007, 2009  Ludovic Court�s <ludo@gnu.org>
 ;;; Copyright 2003, 2004  Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
-;;; Copyright 2005, 2007  Ludovic Court�s <ludovic.courtes@laas.fr>
 ;;;
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify
@@ -89,6 +89,7 @@
                   (if (null? depth) 0 (car depth))))
         (stack (make-stack #t)))
     (and stack
+         (< depth (stack-length stack))
          (let* ((frame  (stack-ref stack depth))
                 (source (frame-source frame)))
            (and source
-- 
cgit v1.2.3