summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2015-10-28 17:47:48 +0000
committerAndy Wingo <wingo@pobox.com>2015-10-28 17:47:48 +0000
commitfc87033bf0fdc5530842cac8942dd1feaefcfd2a (patch)
tree89c793ef481e39e31a646d0512dba7d340eef960
parente3cc0eeb3a9c94f018540e659c4686f5e986b48c (diff)
downloadguile-fc87033bf0fdc5530842cac8942dd1feaefcfd2a.tar.gz
Stack slots can hold a double
* libguile/frames.h (union scm_vm_stack_element): Add double member. * libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Wire up f64 support.
-rw-r--r--libguile/frames.c5
-rw-r--r--libguile/frames.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index d522e762a..48e963a0f 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -262,7 +262,7 @@ SCM_DEFINE (scm_frame_local_ref, "frame-local-ref", 3, 0, 0,
case STACK_ITEM_SCM:
return item->as_scm;
case STACK_ITEM_F64:
- /* return item->as_f64; */
+ return scm_from_double (item->as_f64);
default:
abort();
}
@@ -298,7 +298,8 @@ SCM_DEFINE (scm_frame_local_set_x, "frame-local-set!", 4, 0, 0,
item->as_scm = val;
break;
case STACK_ITEM_F64:
- /* item->as_f64 = scm_to_double (val); */
+ item->as_f64 = scm_to_double (val);
+ break;
default:
abort();
}
diff --git a/libguile/frames.h b/libguile/frames.h
index c965bbfb7..bb402ae71 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -91,6 +91,7 @@ union scm_vm_stack_element
scm_t_uintptr as_uint;
scm_t_uint32 *as_ip;
SCM as_scm;
+ double as_f64;
/* For GC purposes. */
void *as_ptr;