expression_t *const expr = parse_assignment_expression();
if (expr->kind == EXPR_REFERENCE) {
declaration_t *const decl = expr->reference.declaration;
- if (decl == NULL)
- return create_invalid_expression();
- if (decl->parent_scope == ¤t_function->scope &&
- decl->next == NULL) {
- expression->va_starte.parameter = decl;
- expect(')');
- return expression;
+ if (decl->parent_scope != ¤t_function->scope || decl->next != NULL) {
+ errorf(&expr->base.source_position,
+ "second argument of 'va_start' must be last parameter of the current function");
}
+ expression->va_starte.parameter = decl;
+ expect(')');
+ return expression;
}
- errorf(&expr->base.source_position,
- "second argument of 'va_start' must be last parameter of the current function");
+ expect(')');
end_error:
return create_invalid_expression();
}