summaryrefslogtreecommitdiff
path: root/libguile/programs.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-05 13:44:06 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-05 13:44:06 +0100
commit3b9e095b44a618b9e5781adfaa287e14b0f44d03 (patch)
tree7ca239803d487641aa8d6b91649b71a96dd40762 /libguile/programs.h
parente06e857c8dc1f9f8c25bc4d3e40ce5bf351753d5 (diff)
downloadguile-3b9e095b44a618b9e5781adfaa287e14b0f44d03.tar.gz
fix boot program detection, which in turn makes `make-stack' actually work
* libguile/programs.h (SCM_F_PROGRAM_IS_BOOT, SCM_PROGRAM_IS_BOOT): Flags for determining if a program is a boot program. It turns out that our heuristics e.g. in stacks.c would catch non-boot programs, like programs that end with (goto/args 1), because the 1 is the same byte as `halt'. That took a while to find... * libguile/stacks.c (stack_depth, read_frames): Use the new boot prog macros. (scm_make_stack): Assert that we read the number of frames that we said we would. * libguile/vm.c (really_make_boot_program): Mark boot programs appropriately.
Diffstat (limited to 'libguile/programs.h')
-rw-r--r--libguile/programs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libguile/programs.h b/libguile/programs.h
index 7d9478877..263228bec 100644
--- a/libguile/programs.h
+++ b/libguile/programs.h
@@ -53,12 +53,15 @@ typedef unsigned char scm_byte_t;
extern scm_t_bits scm_tc16_program;
+#define SCM_F_PROGRAM_IS_BOOT (1<<0)
+
#define SCM_PROGRAM_P(x) (SCM_SMOB_PREDICATE (scm_tc16_program, x))
#define SCM_PROGRAM_OBJCODE(x) (SCM_SMOB_OBJECT (x))
#define SCM_PROGRAM_OBJTABLE(x) (SCM_SMOB_OBJECT_2 (x))
#define SCM_PROGRAM_EXTERNALS(x) (SCM_SMOB_OBJECT_3 (x))
#define SCM_PROGRAM_DATA(x) (SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x)))
#define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P)
+#define SCM_PROGRAM_IS_BOOT(x) (SCM_SMOB_FLAGS (x) & SCM_F_PROGRAM_IS_BOOT)
extern SCM scm_make_program (SCM objcode, SCM objtable, SCM externals);