[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 34/36: loader: Handle interned constants as well as plai
From: |
Robin Templeton |
Subject: |
[Guile-commits] 34/36: loader: Handle interned constants as well as plain bytevectors. |
Date: |
Sun, 26 Jan 2025 17:49:18 -0500 (EST) |
bpt pushed a commit to branch wip-elisp-rebased
in repository guile.
commit 5471e9025af14574ad53f38f9b3d18877fd24627
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 cf34bfc19..f9c9e45c1 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] 18/36: compiler macros, (continued)
- [Guile-commits] 18/36: compiler macros, Robin Templeton, 2025/01/26
- [Guile-commits] 19/36: defsubst, Robin Templeton, 2025/01/26
- [Guile-commits] 14/36: fix symbol-function, Robin Templeton, 2025/01/26
- [Guile-commits] 21/36: fset macro, Robin Templeton, 2025/01/26
- [Guile-commits] 28/36: use guile eval for elisp tree-il, Robin Templeton, 2025/01/26
- [Guile-commits] 30/36: use standard evaluator, Robin Templeton, 2025/01/26
- [Guile-commits] 08/36: read nil/t as #nil/#t, Robin Templeton, 2025/01/26
- [Guile-commits] 03/36: multiple obarrays, Robin Templeton, 2025/01/26
- [Guile-commits] 06/36: guile-snarf fix, Robin Templeton, 2025/01/26
- [Guile-commits] 22/36: eval-when, Robin Templeton, 2025/01/26
- [Guile-commits] 34/36: loader: Handle interned constants as well as plain bytevectors.,
Robin Templeton <=
- [Guile-commits] 26/36: execute top level require forms, Robin Templeton, 2025/01/26
- [Guile-commits] 32/36: ignore 'expect-fail' forms in elisp tests, Robin Templeton, 2025/01/26
- [Guile-commits] 16/36: elisp @@ macro, Robin Templeton, 2025/01/26
- [Guile-commits] 35/36: elisp: boot: Replace removed FRAME-PROCEDURE with FRAME-PROCEDURE-NAME., Robin Templeton, 2025/01/26
- [Guile-commits] 25/36: top level fixes, Robin Templeton, 2025/01/26
- [Guile-commits] 29/36: guile-backtrace function, Robin Templeton, 2025/01/26
- [Guile-commits] 24/36: only evaluate top-level macro definitions, Robin Templeton, 2025/01/26
- [Guile-commits] 07/36: elisp updates, Robin Templeton, 2025/01/26
- [Guile-commits] 27/36: deprecated eval-when situations, Robin Templeton, 2025/01/26