summaryrefslogtreecommitdiff
path: root/libguile/vm-i-system.c
diff options
context:
space:
mode:
authorMichael Gran <spk121@yahoo.com>2009-08-01 10:15:20 -0700
committerMichael Gran <spk121@yahoo.com>2009-08-01 10:15:20 -0700
commit4c402b889eecaa7ffc61da6656f415c8c983507a (patch)
tree3f2abeffb8a43afce6e04fcdeebfa0ce007edfb2 /libguile/vm-i-system.c
parent64bad3f5a8d7351a41a5b9ccb1df5c393a48b4a9 (diff)
downloadguile-4c402b889eecaa7ffc61da6656f415c8c983507a.tar.gz
Don't use GNU extensions for SCM_MAKE_CHAR macro
Since the contents of SCM_MAKE_CHAR are evaluated more than once, don't use it in situations where this could cause side-effects. * libguile/vm-i-system.c (make-char8): avoid side-effects with SCM_MAKE_CHAR call * libguile/chars.h (SCM_MAKE_CHAR): modified
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r--libguile/vm-i-system.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index ecafbebdd..4536b91da 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -171,7 +171,13 @@ VM_DEFINE_INSTRUCTION (15, make_uint64, "make-uint64", 8, 0, 1)
VM_DEFINE_INSTRUCTION (16, make_char8, "make-char8", 1, 0, 1)
{
- PUSH (SCM_MAKE_CHAR (FETCH ()));
+ scm_t_uint8 v = 0;
+ v = FETCH ();
+
+ PUSH (SCM_MAKE_CHAR (v));
+ /* Don't simplify this to PUSH (SCM_MAKE_CHAR (FETCH ())). The
+ contents of SCM_MAKE_CHAR may be evaluated more than once,
+ resulting in a double fetch. */
NEXT;
}