+2004-06-08 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * src/SDCCicode.c (geniCodeJumpTable): fixed bug #967601
+ * src/SDCCpeeph.c (labelIsReturnOnly): fixed bug #966505
+
2004-06-07 Vangelis Rokas <vrokas AT otenet.gr>
Cumulative patch for pic16 port:
falseLabel = newiTempLabel (buffer);
+ /* If cond is volatile, it might change after the boundary */
+ /* conditions are tested to an out of bounds value, causing */
+ /* a jump to a location outside of the jump table. To avoid */
+ /* this possibility, use a non-volatile copy of it instead. */
+ if (IS_OP_VOLATILE (cond))
+ {
+ operand * newcond;
+ iCode * ic;
+
+ newcond = newiTempOperand (operandType (cond), TRUE);
+ newcond->isvolatile = 0;
+ ic = newiCode ('=', NULL, cond);
+ IC_RESULT (ic) = newcond;
+ ADDTOCHAIN (ic);
+ cond = newcond;
+ }
+
/* so we can create a jumptable */
/* first we rule out the boundary conditions */
/* if only optimization says so */
len = strlen(label);
for(pl = currPl; pl; pl = pl->next) {
- if (pl->line && !pl->isDebug &&
+ if (pl->line && !pl->isDebug && !pl->isComment &&
pl->line[strlen(pl->line)-1] == ':') {
if (strncmp(pl->line, label, len) == 0) break; /* Found Label */
if (strlen(pl->line) != 7 || !isdigit(*(pl->line)) ||
}
if (!pl) return FALSE; /* did not find the label */
pl = pl->next;
+ while (pl && (pl->isDebug || pl->isComment))
+ pl = pl->next;
if (!pl || !pl->line || pl->isDebug) return FALSE; /* next line not valid */
p = pl->line;
for (p = pl->line; *p && isspace(*p); p++)