[Nickle] nickle: Branch 'master' - 2 commits
Keith Packard
keithp at keithp.com
Wed Mar 22 22:47:07 PDT 2017
New commits:
commit 3d63abf4e3cc8089d8cd661fd824dc7f95a5a80e
Author: Keith Packard <keithp at keithp.com>
Date: Thu Mar 23 06:45:53 2017 +0100
Update to version 2.79
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/configure.ac b/configure.ac
index ba9d7ce..7a51231 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,8 +6,8 @@ dnl for licensing information.
AC_PREREQ([2.69])
-AC_INIT([nickle],[2.78],[http://nickle.org],[nickle])
-RELEASE_DATE="2017-03-15"
+AC_INIT([nickle],[2.79],[http://nickle.org],[nickle])
+RELEASE_DATE="2017-03-16"
AC_CONFIG_SRCDIR([nickle.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
diff --git a/debian/changelog b/debian/changelog
index d550556..7c3ad4c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nickle (2.79-1) unstable; urgency=low
+
+ * Fix bus error on sparc64 due to unaligned DataCache.
+
+ -- Keith Packard <keithp at keithp.com> Thu, 16 Mar 2017 10:52:49 -0700
+
nickle (2.78-1) unstable; urgency=low
* Add sudoku generator and solver example.
diff --git a/value.c b/value.c
index 7add3cd..8d60e8a 100644
--- a/value.c
+++ b/value.c
@@ -882,12 +882,12 @@ DataCacheMark (void *object)
static DataType DataCacheType = { DataCacheMark, 0, "DataCacheType" };
-DataCachePtr
-NewDataCache (int size)
+DataCachePtr
+NewDataCache (intptr_t size)
{
ENTER ();
DataCachePtr dc;
- dc = (DataCachePtr) MemAllocate (&DataCacheType,
+ dc = (DataCachePtr) MemAllocate (&DataCacheType,
sizeof (DataCache) +
size * sizeof (void *));
dc->size = size;
commit fb25c7d70763848f4bbb110c747ece6a0a667c29
Author: Keith Packard <keithp at keithp.com>
Date: Thu Mar 16 10:51:13 2017 -0700
Ensure data cache value array is aligned adequately
Data caches are used to store pointers and other potentially long
values. Make sure that the position of the values portion of the cache
is aligned to a suitable address. Fixes a bus error on sparc64 machines.
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/value.h b/value.h
index 8b7b538..365b18f 100644
--- a/value.h
+++ b/value.h
@@ -1013,11 +1013,15 @@ extern BoxPtr NewBox (Bool constant, Bool array, int nvalues, TypePtr type);
extern BoxPtr NewTypedBox (Bool array, BoxTypesPtr types);
void BoxSetReplace (BoxPtr old, BoxPtr new, int oldstride, int newstride);
BoxPtr BoxRewrite (BoxPtr box, int *ep);
-
+
typedef struct {
DataType *data;
int size;
- char values[0];
+ union {
+ double d;
+ double_digit dd;
+ void *p;
+ } values[0];
} DataCache, *DataCachePtr;
DataCachePtr NewDataCache (int size);
More information about the Nickle
mailing list