Add patch to fix undefined behavior (rhbz#2339979)
- Add two patches to fix memory leaks - Do not force -O1
This commit is contained in:
parent
00ea9b0d97
commit
3f3e034be0
4 changed files with 115 additions and 5 deletions
46
clisp-undefined-behavior.patch
Normal file
46
clisp-undefined-behavior.patch
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118779
|
||||
|
||||
--- src/package.d.orig 2024-12-28 00:47:59.000000000 -0700
|
||||
+++ src/package.d 2025-02-07 12:00:00.646094825 -0700
|
||||
@@ -188,12 +188,12 @@ local maygc object rehash_symtab (object
|
||||
first process the symbols, that sit in lists
|
||||
(maybe Conses become free): */
|
||||
{
|
||||
- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */
|
||||
+ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */
|
||||
var uintC count = oldsize;
|
||||
do {
|
||||
var object oldentry = /* entry with number index in oldtable */
|
||||
*(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0],
|
||||
- (aint)offset));
|
||||
+ offset));
|
||||
if (consp(oldentry)) /* this time process only non-empty symbol-lists */
|
||||
do {
|
||||
pushSTACK(Cdr(oldentry)); /* save rest-list */
|
||||
@@ -205,22 +205,22 @@ local maygc object rehash_symtab (object
|
||||
newinsert(Car(oldentry),newsize);
|
||||
oldentry = popSTACK(); /* rest-list */
|
||||
} while (consp(oldentry));
|
||||
- offset++;
|
||||
+ offset += sizeof(gcv_object_t);
|
||||
} while (--count);
|
||||
}
|
||||
{ /* then process symbols, that sit there collision-free: */
|
||||
- var gcv_object_t* offset = 0; /* offset = sizeof(gcv_object_t)*index */
|
||||
+ var aint offset = 0; /* offset = sizeof(gcv_object_t)*index */
|
||||
var uintC count;
|
||||
dotimespC(count,oldsize, {
|
||||
var object oldentry = /* entry with number index in oldtable */
|
||||
*(gcv_object_t*)(pointerplus(&TheSvector(STACK_2)->data[0],
|
||||
- (aint)offset));
|
||||
+ offset));
|
||||
if (!listp(oldentry)) { /* this time process only symbols /= NIL */
|
||||
pushSTACK(oldentry); /* dummy, so that the stack is fine */
|
||||
newinsert(oldentry,newsize); /* enter into the new table */
|
||||
skipSTACK(1);
|
||||
}
|
||||
- offset++;
|
||||
+ offset += sizeof(gcv_object_t);
|
||||
});
|
||||
}
|
||||
/* stack layout: tab, oldtable, free-conses, newtable. */
|
||||
Loading…
Add table
Add a link
Reference in a new issue