summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-08-06 17:03:56 -0400
committerMark H Weaver <mhw@netris.org>2013-08-06 17:03:56 -0400
commite7f64971ed62a6b58f86b5d90a15b24733e36a8d (patch)
treebc093316d999eb2b699ed7b5dd1cfb3d9367996a /libguile
parentd2295ba5716b60a5f0b28b1b91fd2ed3cf1192f5 (diff)
RTL VM: Avoid untagging inums in 'logand' and 'logior'.
* libguile/vm-engine.c (logand, logior): Avoid untagging.
Diffstat (limited to 'libguile')
-rw-r--r--libguile/vm-engine.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 9f3ff5679..613c638e4 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -2963,7 +2963,8 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
{
ARGS2 (x, y);
if (SCM_I_INUMP (x) && SCM_I_INUMP (y))
- RETURN (SCM_I_MAKINUM (SCM_I_INUM (x) & SCM_I_INUM (y)));
+ /* Compute bitwise AND without untagging */
+ RETURN (SCM_PACK (SCM_UNPACK (x) & SCM_UNPACK (y)));
SYNC_IP ();
RETURN (scm_logand (x, y));
}
@@ -2976,7 +2977,8 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
{
ARGS2 (x, y);
if (SCM_I_INUMP (x) && SCM_I_INUMP (y))
- RETURN (SCM_I_MAKINUM (SCM_I_INUM (x) | SCM_I_INUM (y)));
+ /* Compute bitwise OR without untagging */
+ RETURN (SCM_PACK (SCM_UNPACK (x) | SCM_UNPACK (y)));
SYNC_IP ();
RETURN (scm_logior (x, y));
}