int uns = exp->ex_type->tp_unsigned;
if (is_cp_cst(exp)) {
- *expp = new_expr();
- **expp = *exp;
- /* sprint(buf+1, "%ld", (long)(exp->VL_VALUE));
- /* buf[0] = '-';
- */
- exp = *expp; /* ??? */
-
exp->ex_type = tp;
exp->ex_class = Float;
flt_arith2flt(exp->VL_VALUE, &(exp->FL_ARITH), uns);
where o1 == (*expp)->VL_VALUE;
and ((oper == AND) || (oper == OR))
*/
- if ((oper == AND) == (ex->VL_VALUE != (arith)0))
+ if ((oper == AND) == (ex->VL_VALUE != (arith)0)) {
*expp = expr;
+ }
else {
ex->ex_flags |= expr->ex_flags;
free_expression(expr);
#ifdef LINT
hwarning("condition in ?: expression is constant");
#endif /* LINT */
- *expp = (*expp)->VL_VALUE ?
- expr->OP_LEFT : expr->OP_RIGHT;
+ if ((*expp)->VL_VALUE) {
+ free_expression(*expp);
+ free_expression(expr->OP_RIGHT);
+ *expp = expr->OP_LEFT;
+ }
+ else {
+ free_expression(*expp);
+ free_expression(expr->OP_LEFT);
+ *expp = expr->OP_RIGHT;
+ }
+ free_expr(expr);
(*expp)->ex_flags |= EX_ILVALUE;
}
else {
#ifdef LINT
hwarning("constant expression ignored");
#endif /* LINT */
+ free_expression(*expp);
*expp = expr;
}
else {
if (!InsertFile(filenm, &inctable[tok==FILESPECIFIER],&result)){
lexerror("cannot open include file \"%s\"", filenm);
add_dependency(filenm);
+ free(filenm);
}
else {
add_dependency(result);
C_ms_std(FileName, N_BINCL, 0);
}
#endif /* DBSYMTAB */
+ if (result != filenm) free(filenm);
}
}
}
int i;
register char *new = text;
- if (++inc_total > inc_max) {
+ if (inc_total >= inc_max) {
inctable = (char **)
Realloc((char *)inctable,
(unsigned)((inc_max+=10)*sizeof(char *)));
inctable[i] = new;
new = tmp;
}
+ inc_total++;
}
else inctable[inc_pos] = 0;
break;