mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
loader: Handle interned constants as well as plain bytevectors.
This is a follow-up to commit b04e79283ada9a6af05552dda6446a0934c0fbe2. * libguile/loader.c (scm_load_thunk_from_memory): Extract constants only if the object is a pair. (cherry picked from commit c536c297683178e6eadc0a60d1e53f8c510db3c9)
This commit is contained in:
parent
e38f6377e3
commit
726f34b35d
1 changed files with 15 additions and 6 deletions
|
@ -598,12 +598,21 @@ SCM_DEFINE (scm_load_thunk_from_memory, "load-thunk-from-memory", 1, 0, 0,
|
|||
size_t len;
|
||||
SCM bv, constants;
|
||||
|
||||
if (scm_is_pair (obj))
|
||||
{
|
||||
SCM_VALIDATE_CONS (1, obj);
|
||||
bv = scm_car (obj);
|
||||
constants = scm_cdr (obj);
|
||||
SCM_ASSERT (scm_is_bytevector (bv)
|
||||
&& (scm_is_vector (constants) || scm_is_false (constants)),
|
||||
obj, 1, FUNC_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
SCM_VALIDATE_BYTEVECTOR (1, obj);
|
||||
bv = obj;
|
||||
constants = SCM_BOOL_F;
|
||||
}
|
||||
|
||||
data = (char *) SCM_BYTEVECTOR_CONTENTS (bv);
|
||||
len = SCM_BYTEVECTOR_LENGTH (bv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue