Blob Blame History Raw
diff -up abuse-0.7.1/src/stack.hpp.foo abuse-0.7.1/src/stack.hpp
--- abuse-0.7.1/src/stack.hpp.foo	2008-09-07 15:14:12.000000000 +0200
+++ abuse-0.7.1/src/stack.hpp	2008-09-07 15:14:18.000000000 +0200
@@ -25,8 +25,13 @@ template<class T> class grow_stack      
   long son;
   long smax;
 
+  /* <sigh> the max_size parameter is the number of bytes of the pointerstack
+     instead of the number of entries which it ofcourse should have been.
+     This breaks on 64 bit since the caller assumes 4 bytes per pointer and
+     thus on 64 bit allocates not enough memory. Instead of fixing all callers
+     we work around this by multiplying maxsize by 2 on 64 bit. */
   grow_stack(int max_size) {
-    smax=max_size;
+    smax=max_size/sizeof(int32_t);
     son=0;
     sdata=(T **)jmalloc(sizeof(T *)*smax,"pointer stack");
   }