]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Fix ROUND_END_PTR so that it adds the size after casting to jit_nuint.
authorRhys Weatherley <rweather@southern-storm.com.au>
Mon, 7 Jun 2004 22:07:11 +0000 (22:07 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Mon, 7 Jun 2004 22:07:11 +0000 (22:07 +0000)
ChangeLog
jit/jit-alloc.c

index 89f81b347f7ab5564c88ef513a3be7c8dddce8ce..9aa0daa7cba3a2d50e654c38b58c5b2cf849d10a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 
+2004-06-08  Miroslaw Dobrzanski-Neumann  <mne@mosaic-ag.com>
+
+       * jit/jit-alloc.c: fix ROUND_END_PTR so that it adds the size
+       after casting to jit_nuint.
+
 2004-06-07  Thong Nguyen  <tim@veridicus.com>
 
        * configure.in, jit/jit-insn.c: add "_setjmp" to the list of
index 35867b197899abeac3f265b180d91bb3b7e64f98..cd3ea47388172de98e332b21f664e8aa61f3286d 100644 (file)
@@ -158,8 +158,8 @@ void jit_flush_exec(void *ptr, unsigned int size)
 
 #define ROUND_BEG_PTR(p) \
        ((void *)((((jit_nuint)(p)) / CLSIZE) * CLSIZE))
-#define ROUND_END_PTR(p) \
-       ((void *)(((((jit_nuint)(p)) + CLSIZE - 1)/CLSIZE)*CLSIZE))
+#define ROUND_END_PTR(p,s) \
+       ((void *)(((((jit_nuint)(p)) + (s) + CLSIZE - 1)/CLSIZE)*CLSIZE))
 
 #if defined(__GNUC__)
 #if defined(PPC)
@@ -171,7 +171,7 @@ void jit_flush_exec(void *ptr, unsigned int size)
 
        /* Flush the data out of the data cache */
        p   = ROUND_BEG_PTR (ptr);
-       end = ROUND_END_PTR (p + size);
+       end = ROUND_END_PTR (p, size);
        while (p < end)
        {
                __asm__ __volatile__ ("dcbst 0,%0" :: "r"(p));
@@ -194,7 +194,7 @@ void jit_flush_exec(void *ptr, unsigned int size)
 
        /* Flush the CPU cache on sparc platforms */
        register unsigned char *p   = ROUND_BEG_PTR (ptr);
-       register unsigned char *end = ROUND_END_PTR (p + size);
+       register unsigned char *end = ROUND_END_PTR (p, size);
        __asm__ __volatile__ ("stbar");
        while (p < end)
        {
@@ -221,7 +221,7 @@ void jit_flush_exec(void *ptr, unsigned int size)
 #elif (defined(__ia64) || defined(__ia64__)) && defined(linux)
 #define CLSIZE 32
        register unsigned char *p   = ROUND_BEG_PTR (ptr);
-       register unsigned char *end = ROUND_END_PTR (p + size);
+       register unsigned char *end = ROUND_END_PTR (p, size);
        while(p < end)
        {
                asm volatile("fc %0" :: "r"(p));