summaryrefslogtreecommitdiff
path: root/libguile/frames.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-12-14 23:11:47 +0100
committerLudovic Courtès <ludo@gnu.org>2009-12-15 01:01:16 +0100
commit3dbbe28dfd90cd7bf68d8d07771dffc724064311 (patch)
tree32dc56d5a966e1f895dd8c028d0f1ea9379016d3 /libguile/frames.c
parentcd169c5a2284c019b3909de67fc0e3f2b0a5dd44 (diff)
downloadguile-3dbbe28dfd90cd7bf68d8d07771dffc724064311.tar.gz
Don't use GCC zero-length arrays.
* libguile/frames.c, libguile/objcodes.c, libguile/programs.c, libguile/vm-engine.c, libguile/vm-i-system.c, libguile/vm.c: Use `SCM_C_OBJCODE_BASE ()' instead of accessing the `base' field of `struct scm_objcode'. * libguile/objcodes.h (struct scm_objcode)[base]: Remove.
Diffstat (limited to 'libguile/frames.c')
-rw-r--r--libguile/frames.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index 80c556b45..5c61eb088 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -111,7 +111,8 @@ SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
bp = SCM_PROGRAM_DATA (SCM_FRAME_PROGRAM (fp));
return scm_c_program_source (SCM_FRAME_PROGRAM (fp),
- SCM_VM_FRAME_IP (frame) - bp->base);
+ SCM_VM_FRAME_IP (frame)
+ - SCM_C_OBJCODE_BASE (bp));
}
#undef FUNC_NAME
@@ -219,10 +220,14 @@ SCM_DEFINE (scm_frame_instruction_pointer, "frame-instruction-pointer", 1, 0, 0,
"")
#define FUNC_NAME s_scm_frame_instruction_pointer
{
+ const struct scm_objcode *c_objcode;
+
SCM_VALIDATE_VM_FRAME (1, frame);
+
+ c_objcode = SCM_PROGRAM_DATA (scm_frame_procedure (frame));
return scm_from_ulong ((unsigned long)
(SCM_VM_FRAME_IP (frame)
- - SCM_PROGRAM_DATA (scm_frame_procedure (frame))->base));
+ - SCM_C_OBJCODE_BASE (c_objcode)));
}
#undef FUNC_NAME