Fix synchronization between data and instr caches
authorThomas Preud'homme <robotux@celest.fr>
Tue, 19 Mar 2013 13:03:15 +0000 (19 14:03 +0100)
committerThomas Preud'homme <robotux@celest.fr>
Tue, 19 Mar 2013 13:03:15 +0000 (19 14:03 +0100)
tccrun.c

index 174b6c2..d858ae6 100644 (file)
--- a/tccrun.c
+++ b/tccrun.c
@@ -225,7 +225,7 @@ static void set_pages_executable(void *ptr, unsigned long length)
     end = (addr_t)ptr + length;
     end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1);
     mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC);
-    __clear_cache(ptr, prog_main + length);
+    __clear_cache(ptr, ptr + length);
 #endif
 }