summaryrefslogtreecommitdiff
path: root/libguile/frames.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-05-11 14:31:17 +0200
committerAndy Wingo <wingo@pobox.com>2012-05-11 14:31:17 +0200
commitee6207d6f5c8675dc8dee36dbdb815dbc5b71b4a (patch)
tree7b4585b495647ae48a832e97cfeb30bd0b70e65c /libguile/frames.c
parent968a9add65c5e3a33ab9f5b7697051c5b9282060 (diff)
parentda874e5415f2d9438e66b9989086465b6cbf578c (diff)
downloadguile-ee6207d6f5c8675dc8dee36dbdb815dbc5b71b4a.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
Diffstat (limited to 'libguile/frames.c')
-rw-r--r--libguile/frames.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index b90b5a28c..0338d18db 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -104,11 +104,18 @@ SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
"")
#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
@@ -296,6 +303,7 @@ SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
#define FUNC_NAME s_scm_frame_previous
{
SCM *this_fp, *new_fp, *new_sp;
+ SCM proc;
SCM_VALIDATE_VM_FRAME (1, frame);
@@ -303,13 +311,16 @@ SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
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;