[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 177/437: Correct reference to dangling pointer and bette
From: |
Andy Wingo |
Subject: |
[Guile-commits] 177/437: Correct reference to dangling pointer and better note bounds checking |
Date: |
Mon, 2 Jul 2018 05:14:12 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 2da31e82fa52411a49b7564cb5cbf4bdb4a0ff2d
Author: pcpa <address@hidden>
Date: Fri Jan 18 18:26:14 2013 -0200
Correct reference to dangling pointer and better note bounds checking
lib/jit_note.c: Correct bounds check and wrong code keeping
a pointer that could be changed after a realloc call.
---
ChangeLog | 5 +++++
lib/jit_note.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5e96042..84d3c43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2013-01-18 Paulo Andrade <address@hidden>
+ lib/jit_note.c: Correct bounds check and wrong code keeping
+ a pointer that could be changed after a realloc call.
+
+2013-01-18 Paulo Andrade <address@hidden>
+
* check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
diff --git a/lib/jit_note.c b/lib/jit_note.c
index 08b535d..29bdc3f 100644
--- a/lib/jit_note.c
+++ b/lib/jit_note.c
@@ -195,10 +195,10 @@ _new_note(jit_state_t *_jit, jit_uint8_t *code, char
*name)
_jit->note.ptr = malloc(sizeof(jit_note_t) * 8);
}
else {
- prev = _jit->note.ptr + _jit->note.length - 1;
if ((_jit->note.length & 7) == 7)
_jit->note.ptr = realloc(_jit->note.ptr, sizeof(jit_note_t) *
(_jit->note.length + 9));
+ prev = _jit->note.ptr + _jit->note.length - 1;
}
if (prev) {
assert(code >= prev->code);
@@ -255,7 +255,7 @@ _note_search_index(jit_state_t *_jit, jit_uint8_t *code)
if (code < notes[index].code)
top = index;
else if (code >= notes[index].code &&
- code - notes[index].code <= notes[index].size)
+ code - notes[index].code < notes[index].size)
break;
else
bot = index + 1;
- [Guile-commits] 135/437: Correct implementation problems on ix86., (continued)
- [Guile-commits] 135/437: Correct implementation problems on ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 169/437: Correct wrong and confusing reverse float comparison logic, Andy Wingo, 2018/07/02
- [Guile-commits] 139/437: Implement sqrt codes in mips., Andy Wingo, 2018/07/02
- [Guile-commits] 134/437: Correct make distcheck., Andy Wingo, 2018/07/02
- [Guile-commits] 156/437: Simplify listing of test cases with alternate jit generation options, Andy Wingo, 2018/07/02
- [Guile-commits] 157/437: Add two extra test cases for float operations., Andy Wingo, 2018/07/02
- [Guile-commits] 161/437: Add new register clobber detection test case., Andy Wingo, 2018/07/02
- [Guile-commits] 164/437: Add new carry test case., Andy Wingo, 2018/07/02
- [Guile-commits] 138/437: Correct mips backend implementation to pass initial tests., Andy Wingo, 2018/07/02
- [Guile-commits] 163/437: Add missing jit_htonr to ppc backend., Andy Wingo, 2018/07/02
- [Guile-commits] 177/437: Correct reference to dangling pointer and better note bounds checking,
Andy Wingo <=
- [Guile-commits] 167/437: Change type of return of jit_arg* and argument to jit_getarg*, Andy Wingo, 2018/07/02
- [Guile-commits] 168/437: Add new extensive float comparison and conversion test case, Andy Wingo, 2018/07/02
- [Guile-commits] 192/437: Correct SPARC optimized assembly example in documentation, Andy Wingo, 2018/07/02
- [Guile-commits] 93/437: subtract 1 from the final byte being flushed in PPC jit_flush_code, Andy Wingo, 2018/07/02
- [Guile-commits] 176/437: Add the new jit_name call to mark function boundaries, Andy Wingo, 2018/07/02
- [Guile-commits] 146/437: Add several arithmetic and branch tests cases., Andy Wingo, 2018/07/02
- [Guile-commits] 191/437: Add updated sparc example from lightning 1.2c documentation., Andy Wingo, 2018/07/02
- [Guile-commits] 151/437: Add new varargs test and correct related test case failures in all ports., Andy Wingo, 2018/07/02
- [Guile-commits] 198/437: Remove non optional gmp dependency., Andy Wingo, 2018/07/02
- [Guile-commits] 202/437: Ensure the end argument of __clear_cache is page aligned., Andy Wingo, 2018/07/02