First check in
This commit is contained in:
16
SRC/patches/01_fix-segfault-jumping-to-label.patch
Normal file
16
SRC/patches/01_fix-segfault-jumping-to-label.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff -purN a/bc/execute.c b/bc/execute.c
|
||||
--- a/bc/execute.c 2006-09-04 21:39:31.000000000 -0500
|
||||
+++ b/bc/execute.c 2016-09-09 12:57:14.756000000 -0500
|
||||
@@ -133,7 +133,11 @@ execute ()
|
||||
gp = functions[pc.pc_func].f_label;
|
||||
l_gp = label_num >> BC_LABEL_LOG;
|
||||
l_off = label_num % BC_LABEL_GROUP;
|
||||
- while (l_gp-- > 0) gp = gp->l_next;
|
||||
+ while (gp && l_gp-- > 0) gp = gp->l_next;
|
||||
+ if (!gp) {
|
||||
+ rt_error ("No label group for label %d.", label_num);
|
||||
+ break;
|
||||
+ }
|
||||
pc.pc_addr = gp->l_adrs[l_off];
|
||||
}
|
||||
break;
|
||||
24
SRC/patches/02_fix-memory-leak.patch
Normal file
24
SRC/patches/02_fix-memory-leak.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
diff -purN a/bc/bc.y b/bc/bc.y
|
||||
--- a/bc/bc.y 2006-09-04 21:39:31.000000000 -0500
|
||||
+++ b/bc/bc.y 2016-09-09 13:02:41.476000000 -0500
|
||||
@@ -569,6 +569,7 @@ expression : named_expression ASSIGN_O
|
||||
generate (">");
|
||||
break;
|
||||
}
|
||||
+ free($2);
|
||||
}
|
||||
| expression '+' expression
|
||||
{
|
||||
diff -purN a/bc/util.c b/bc/util.c
|
||||
--- a/bc/util.c 2006-09-04 21:39:31.000000000 -0500
|
||||
+++ b/bc/util.c 2016-09-09 13:02:41.476000000 -0500
|
||||
@@ -602,8 +602,7 @@ lookup (name, namekind)
|
||||
case FUNCTDEF:
|
||||
if (id->f_name != 0)
|
||||
{
|
||||
- if (namekind != FUNCT)
|
||||
- free(name);
|
||||
+ free(name);
|
||||
/* Check to see if we are redefining a math lib function. */
|
||||
if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
|
||||
id->f_name = next_func++;
|
||||
11
SRC/patches/03_fix-uninitialized-variable.patch
Normal file
11
SRC/patches/03_fix-uninitialized-variable.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -purN a/bc/storage.c b/bc/storage.c
|
||||
--- a/bc/storage.c 2006-09-04 21:39:31.000000000 -0500
|
||||
+++ b/bc/storage.c 2016-09-09 13:05:09.720000000 -0500
|
||||
@@ -99,6 +99,7 @@ more_functions (VOID)
|
||||
{
|
||||
f = &functions[indx];
|
||||
f->f_defined = FALSE;
|
||||
+ f->f_void = FALSE;
|
||||
f->f_body = (char *) bc_malloc (BC_START_SIZE);
|
||||
f->f_body_size = BC_START_SIZE;
|
||||
f->f_code_size = 0;
|
||||
2
SRC/patches/README
Normal file
2
SRC/patches/README
Normal file
@@ -0,0 +1,2 @@
|
||||
Place any patch files here and preface each with a number indicating
|
||||
the order of execution. Patch files are expected to use a .patch extension.
|
||||
Reference in New Issue
Block a user