File: 0020-Eight-byte-align-statically-allocated-stringbufs.patch

package info (click to toggle)
guile-3.0 3.0.10%2Breally3.0.10-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 35,800 kB
  • sloc: ansic: 183,632; lisp: 99,770; sh: 4,603; makefile: 1,845; awk: 239; javascript: 9
file content (31 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 426e2d0bdb283e25386a302d81202a6ddbfdbec0 Mon Sep 17 00:00:00 2001
From: Rob Browning <rlb@defaultvalue.org>
Date: Thu, 28 Nov 2024 13:01:01 -0600
Subject: Eight byte align statically allocated stringbufs

Previously they were unaligned, unlike their parent strings, and so
could end up with the wrong pointer tag.  Observed on i686-linux-gnu,
where they ended up tagged as immediates (SCM_IMP()), causing failures
in TYP7 related checks.

* libguile/strings.h (SCM_IMMUTABLE_STRINGBUF): align resulting buffer
  via SCM_ALIGNED(8).

Origin: upstream, commit 76afb429ee7a8a4c9eddb20bf29a2246192f8a28
---
 libguile/strings.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libguile/strings.h b/libguile/strings.h
index f28ef3246..d417514f8 100644
--- a/libguile/strings.h
+++ b/libguile/strings.h
@@ -184,7 +184,7 @@ SCM_API SCM scm_makfromstrs (int argc, char **argv);
 
 #ifdef SCM_SUPPORT_STATIC_ALLOCATION
 #define SCM_IMMUTABLE_STRINGBUF(c_name, contents)	\
-  static SCM_UNUSED const				\
+  static SCM_UNUSED SCM_ALIGNED(8) const		\
   struct						\
   {							\
     scm_t_bits word_0;					\