aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/bypass_bigrecy_32bit.patch
blob: 276bc8cb4e38c0f8eefeebd47afc6c27eed6b967 (plain)
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
Description: Bypass bigrecy() optimization on 32-bit to fix test failure
Author: Bryan Newbold <bnewbold@robocracy.org>
Forwarded: yes
--- a/scl.c
+++ b/scl.c
@@ -132,12 +132,20 @@ void strrecy(str)
 void bigrecy(bgnm)
      SCM bgnm;
 {
+/* As an emergency patch, only implement this GC optimization on specific
+ * 64-bit platforms.
+ * There is a "use-after-free" bug on 32-bit platforms, introduced as a
+ * regression between 5f1 and 5f2. --bnewbold (2017-09-30)
+ */
+#if defined(__ia64__) || defined(__powerpc64__) || defined(__x86_64__) \
+    || defined(__aarch64__)
   if (IMP(bgnm) || !BIGP(bgnm)) return;
   DEFER_INTS;
   must_free(CHARS(bgnm), (sizet)NUMDIGS(bgnm)*sizeof(BIGDIG));
   CAR(bgnm) = INUM0;
   CDR(bgnm) = INUM0;
   ALLOW_INTS;
+#endif
 }
 
 /* can convert to string accurately with bignums */