irerror(self->context, "unreachable statement (%s)", self->label);
return false;
}
- in = ir_instr_new(ctx, self, op);
- if (!in)
- return false;
if (target->store == store_value &&
(op < INSTR_STOREP_F || op > INSTR_STOREP_FNC))
return false;
}
+ in = ir_instr_new(ctx, self, op);
+ if (!in)
+ return false;
+
if (!ir_instr_op(in, 0, target, true) ||
!ir_instr_op(in, 1, what, false))
{
+ ir_instr_delete(in);
return false;
}
vec_push(self->instr, in);
if (!in)
return false;
- if (v && !ir_instr_op(in, 0, v, false))
+ if (v && !ir_instr_op(in, 0, v, false)) {
+ ir_instr_delete(in);
return false;
+ }
vec_push(self->instr, in);
return true;
fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
else
parseerror(parser, "too %s parameters for function call: expected %i, got %i\n"
- " -> `%s` has been declared here: %s:%i",
- fewmany, fval->name, (int)vec_size(fun->expression.params), (int)paramcount,
- fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
+ " -> it has been declared here: %s:%i",
+ fewmany, (int)vec_size(fun->expression.params), (int)paramcount,
+ ast_ctx(fun).file, (int)ast_ctx(fun).line);
return false;
}
else
else
return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
"too %s parameters for function call: expected %i, got %i\n"
- " -> `%s` has been declared here: %s:%i",
- fewmany, fval->name, (int)vec_size(fun->expression.params), (int)paramcount,
- fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
+ " -> it has been declared here: %s:%i",
+ fewmany, (int)vec_size(fun->expression.params), (int)paramcount,
+ ast_ctx(fun).file, (int)ast_ctx(fun).line);
}
}
}
vec_push(sy.ops, syparen(parser_ctx(parser), SY_PAREN_INDEX, 0));
wantop = false;
} else if (op->id == opid2('?',':')) {
- wantop = false;
vec_push(sy.ops, syop(parser_ctx(parser), op));
vec_push(sy.ops, syparen(parser_ctx(parser), SY_PAREN_TERNARY, 0));
wantop = false;
return false;
}
if (!OPTS_FLAG(RELAXED_SWITCH)) {
- opval = (ast_value*)swcase.value;
- if (!ast_istype(swcase.value, ast_value)) { /* || opval->cvq != CV_CONST) { */
+ if (!ast_istype(swcase.value, ast_value)) { /* || ((ast_value*)swcase.value)->cvq != CV_CONST) { */
parseerror(parser, "case on non-constant values need to be explicitly enabled via -frelaxed-switch");
ast_unref(operand);
return false;