17 lines
531 B
Diff
17 lines
531 B
Diff
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;
|