[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 35/36: loader: Handle interned constants as well as plai
From: |
Christopher Allan Webber |
Subject: |
[Guile-commits] 35/36: loader: Handle interned constants as well as plain bytevectors. |
Date: |
Tue, 19 Oct 2021 17:59:43 -0400 (EDT) |
cwebber pushed a commit to branch wip-elisp-rebased
in repository guile.
commit 6da22a434f520295f0b8156f75c5b2f29b5564d9
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sun May 17 11:56:01 2020 +0200
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)
---
libguile/loader.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/libguile/loader.c b/libguile/loader.c
index cf34bfc..f9c9e45 100644
--- a/libguile/loader.c
+++ b/libguile/loader.c
@@ -598,12 +598,21 @@ SCM_DEFINE (scm_load_thunk_from_memory,
"load-thunk-from-memory", 1, 0, 0,
size_t len;
SCM bv, constants;
- 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);
+ 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);
- [Guile-commits] 31/36: use standard evaluator, (continued)
- [Guile-commits] 31/36: use standard evaluator, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 32/36: update cross-compilation test, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 36/36: elisp: boot: Replace removed FRAME-PROCEDURE with FRAME-PROCEDURE-NAME., Christopher Allan Webber, 2021/10/19
- [Guile-commits] 19/36: compiler macros, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 21/36: use defsubst, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 28/36: deprecated eval-when situations, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 30/36: guile-backtrace function, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 25/36: only evaluate top-level macro definitions, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 33/36: ignore 'expect-fail' forms in elisp tests, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 34/36: temporarily disable elisp exception tests, Christopher Allan Webber, 2021/10/19
- [Guile-commits] 35/36: loader: Handle interned constants as well as plain bytevectors.,
Christopher Allan Webber <=