summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-06-15 15:31:21 +0200
committerAndy Wingo <wingo@pobox.com>2021-10-01 11:28:22 +0200
commit745b67c04aa327e3d261cf5aa5f3ff0ff6bfef5e (patch)
treedc1fdb47905d154bb6095adf14aef0d9c13a2d46 /libguile
parentd4d4336ede625d14434cca98fdb60eb1b282d8a8 (diff)
downloadguile-745b67c04aa327e3d261cf5aa5f3ff0ff6bfef5e.tar.gz
Add frame-local-ref / frame-local-set! support for type 'ptr
* libguile/frames.c (enum stack_item_representation): (scm_to_stack_item_representation): (scm_frame_local_ref): (scm_frame_local_set_x): Add support for "ptr" representations.
Diffstat (limited to 'libguile')
-rw-r--r--libguile/frames.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index 0bb40579c..b2711df5c 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -1,4 +1,4 @@
-/* Copyright 2001,2009-2015,2018
+/* Copyright 2001,2009-2015,2018,2021
Free Software Foundation, Inc.
This file is part of Guile.
@@ -231,7 +231,8 @@ enum stack_item_representation
STACK_ITEM_SCM = 0,
STACK_ITEM_F64 = 1,
STACK_ITEM_U64 = 2,
- STACK_ITEM_S64 = 3
+ STACK_ITEM_S64 = 3,
+ STACK_ITEM_PTR = 4
};
static enum stack_item_representation
@@ -245,6 +246,8 @@ scm_to_stack_item_representation (SCM x, const char *subr, int pos)
return STACK_ITEM_U64;
if (scm_is_eq (x, scm_from_latin1_symbol ("s64")))
return STACK_ITEM_S64;
+ if (scm_is_eq (x, scm_from_latin1_symbol ("ptr")))
+ return STACK_ITEM_PTR;
scm_wrong_type_arg (subr, pos, x);
return 0; /* Not reached. */
@@ -279,6 +282,8 @@ scm_frame_local_ref (SCM frame, SCM index, SCM representation)
return scm_from_uint64 (item->as_u64);
case STACK_ITEM_S64:
return scm_from_int64 (item->as_s64);
+ case STACK_ITEM_PTR:
+ return scm_from_uintptr_t (item->as_uint);
default:
abort();
}
@@ -321,6 +326,8 @@ scm_frame_local_set_x (SCM frame, SCM index, SCM val, SCM representation)
case STACK_ITEM_S64:
item->as_s64 = scm_to_int64 (val);
break;
+ case STACK_ITEM_PTR:
+ item->as_uint = scm_to_uintptr_t (val);
default:
abort();
}