[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 193/437: Make code and data buffer readonly.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 193/437: Make code and data buffer readonly. |
Date: |
Mon, 2 Jul 2018 05:14:16 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit f39eee6694db4880fd5677c89b91ee7095799a55
Author: pcpa <address@hidden>
Date: Wed Mar 6 16:36:38 2013 -0300
Make code and data buffer readonly.
* lib/lightning.c: Make data and code buffer readonly.
---
ChangeLog | 4 ++++
lib/lightning.c | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 16ba88d..ecd84bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-03-06 Paulo Andrade <address@hidden>
+
+ * lib/lightning.c: Make data and code buffer readonly.
+
2013-02-20 Paulo Andrade <address@hidden>
* doc/body.texi: Fool proof validate the examples of what
diff --git a/lib/lightning.c b/lib/lightning.c
index a9b77f6..d069743 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -1376,6 +1376,7 @@ _jit_emit(jit_state_t *_jit)
jit_node_t *node;
jit_int32_t mult;
size_t length;
+ int result;
if (_jit->function)
jit_epilog();
@@ -1430,6 +1431,11 @@ _jit_emit(jit_state_t *_jit)
_jit->done = 1;
jit_annotate();
+ result = mprotect(_jit->data.ptr, _jit->data.length, PROT_READ);
+ assert(result == 0);
+ result = mprotect(_jit->code.ptr, _jit->code.length, PROT_READ |
PROT_EXEC);
+ assert(result == 0);
+
return (code);
}
- [Guile-commits] 274/437: x86: Correct wrong x87 optimization., (continued)
- [Guile-commits] 274/437: x86: Correct wrong x87 optimization., Andy Wingo, 2018/07/02
- [Guile-commits] 271/437: Correct wrong call in ldi_f if address does not fit in 32 bit., Andy Wingo, 2018/07/02
- [Guile-commits] 238/437: test for zlib in configure.ac, Andy Wingo, 2018/07/02
- [Guile-commits] 266/437: Add assertion to detect double patching., Andy Wingo, 2018/07/02
- [Guile-commits] 199/437: Correct wrong shift value for 32 bit, Andy Wingo, 2018/07/02
- [Guile-commits] 294/437: Correct change of possibly wrong bitmask in jit_update, Andy Wingo, 2018/07/02
- [Guile-commits] 291/437: MIPS: Correct use of wrong test register, Andy Wingo, 2018/07/02
- [Guile-commits] 303/437: Only mark callee save regs as live on jumps that cannot be tracked., Andy Wingo, 2018/07/02
- [Guile-commits] 218/437: Build and pass all test cases on a multiprocessor HP-UX., Andy Wingo, 2018/07/02
- [Guile-commits] 285/437: GNU lightning 2.0.4 release, Andy Wingo, 2018/07/02
- [Guile-commits] 193/437: Make code and data buffer readonly.,
Andy Wingo <=
- [Guile-commits] 145/437: Add new test case for int/float to/from conversion., Andy Wingo, 2018/07/02
- [Guile-commits] 308/437: x86: Update instruction size information for Windows x64, Andy Wingo, 2018/07/02
- [Guile-commits] 313/437: Implement the jit_align interface, Andy Wingo, 2018/07/02
- [Guile-commits] 250/437: Add the new jit_pointer_p predicate interface., Andy Wingo, 2018/07/02
- [Guile-commits] 286/437: Do not export private definitions and types., Andy Wingo, 2018/07/02
- [Guile-commits] 147/437: Correct test cases in the mips backend., Andy Wingo, 2018/07/02
- [Guile-commits] 292/437: AARCH64: Correct assertion test, Andy Wingo, 2018/07/02
- [Guile-commits] 305/437: Consider all callee_save_p regs as live on non trackable jumps, Andy Wingo, 2018/07/02
- [Guile-commits] 40/437: checkin rewrite of i386 assembler, Andy Wingo, 2018/07/02
- [Guile-commits] 295/437: Always mark return registers as live in epilog, Andy Wingo, 2018/07/02