wingo pushed a commit to branch lightning
in repository guile.
commit 0c068368ccc1fb46bfa33c06ac81b916eaa21a36
Author: Paolo Bonzini <[email protected]>
Date: Thu May 18 08:15:08 2006 +0000
fix mprotect for i386
2006-05-18 Matthew Flatt <[email protected]>
* lightning/i386/asm.h: Fix test for extending the mprotect area
towards lower addresses.
git-archimport-id: [email protected]/lightning--stable--1.2--patch-21
---
ChangeLog | 5 +++++
lightning/i386/funcs.h | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1930fbd..c7312df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-18 Matthew Flatt <[email protected]>
+
+ * lightning/i386/asm.h: Fix test for extending the mprotect area
+ towards lower addresses.
+
2006-05-16 Bruno Haible <[email protected]>
* lightning/asm-common.h: Don't use __func__ nor __FUNCTION__ if
diff --git a/lightning/i386/funcs.h b/lightning/i386/funcs.h
index d57e14e..ee26d46 100644
--- a/lightning/i386/funcs.h
+++ b/lightning/i386/funcs.h
@@ -74,12 +74,13 @@ jit_flush_code(void *dest, void *end)
/* See if we can extend the previously mprotect'ed memory area towards
higher addresses: the starting address remains the same as before. */
- if (page >= prev_page && page <= prev_page + prev_length)
+ else if (page >= prev_page && page <= prev_page + prev_length)
prev_length = page + length - prev_page;
/* See if we can extend the previously mprotect'ed memory area towards
lower addresses: the highest address remains the same as before. */
- else if (page < prev_page && page + length <= prev_page + prev_length)
+ else if (page < prev_page && page + length >= prev_page
+ && page + length <= prev_page + prev_length)
prev_length += prev_page - page, prev_page = page;
/* Nothing to do, replace the area. */