"")
#define FUNC_NAME s_scm_frame_source
{
+ SCM proc;
+
SCM_VALIDATE_VM_FRAME (1, frame);
- return scm_program_source (scm_frame_procedure (frame),
- scm_frame_instruction_pointer (frame),
- SCM_UNDEFINED);
+ proc = scm_frame_procedure (frame);
+
+ if (SCM_PROGRAM_P (proc))
+ return scm_program_source (scm_frame_procedure (frame),
+ scm_frame_instruction_pointer (frame),
+ SCM_UNDEFINED);
+
+ return SCM_BOOL_F;
}
#undef FUNC_NAME
#define FUNC_NAME s_scm_frame_previous
{
SCM *this_fp, *new_fp, *new_sp;
+ SCM proc;
SCM_VALIDATE_VM_FRAME (1, frame);
this_fp = SCM_VM_FRAME_FP (frame);
new_fp = SCM_FRAME_DYNAMIC_LINK (this_fp);
if (new_fp)
- { new_fp = RELOC (frame, new_fp);
+ {
+ new_fp = RELOC (frame, new_fp);
new_sp = SCM_FRAME_LOWER_ADDRESS (this_fp) - 1;
frame = scm_c_make_frame (SCM_VM_FRAME_STACK_HOLDER (frame),
new_fp, new_sp,
SCM_FRAME_RETURN_ADDRESS (this_fp),
SCM_VM_FRAME_OFFSET (frame));
- if (SCM_PROGRAM_IS_BOOT (scm_frame_procedure (frame)))
+ proc = scm_frame_procedure (frame);
+
+ if (SCM_PROGRAM_P (proc) && SCM_PROGRAM_IS_BOOT (proc))
goto again;
else
return frame;
/* A stack holds a frame chain
- * Copyright (C) 1996,1997,2000,2001, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation
+ * Copyright (C) 1996,1997,2000,2001, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
/* FIXME: is this even possible? */
if (scm_is_true (frame)
+ && SCM_PROGRAM_P (scm_frame_procedure (frame))
&& SCM_PROGRAM_IS_BOOT (scm_frame_procedure (frame)))
frame = scm_frame_previous (frame);
(let ((proc (frame-procedure frame)))
(print-location frame port)
(format port "In procedure ~a:\n"
- (or (procedure-name proc) proc))))
+ (or (false-if-exception (procedure-name proc))
+ proc))))
(print-location frame port)
(catch #t
(define (frame-call-representation frame)
(let ((p (frame-procedure frame)))
(cons
- (or (procedure-name p) p)
+ (or (false-if-exception (procedure-name p)) p)
(cond
((and (program? p)
(program-arguments-alist p (frame-instruction-pointer frame)))