#define PUSH_PARENT(stmt) \
statement_t *const prev_parent = current_parent; \
- current_parent = (stmt);
+ ((void)(current_parent = (stmt)))
#define POP_PARENT ((void)(current_parent = prev_parent))
static source_position_t null_position = { NULL, 0 };
break;
}
- /* Because of scopes and appending other namespaces to the end of
- * the list, this must hold. */
- assert((old_declaration != NULL ? old_declaration->symbol_next : NULL) == iter->symbol_next);
- *anchor = old_declaration;
+ /* Not all declarations adhere scopes (e.g. jump labels), so this
+ * correction is necessary */
+ if (old_declaration != NULL) {
+ old_declaration->symbol_next = iter->symbol_next;
+ *anchor = old_declaration;
+ } else {
+ *anchor = iter->symbol_next;
+ }
}
ARR_SHRINKLEN(*stack_ptr, (int) new_top);
&expression->base.source_position);
initializer_t *const result = allocate_initializer_zero(INITIALIZER_VALUE);
+#if 0
+ if (type->kind == TYPE_BITFIELD) {
+ type = type->bitfield.base_type;
+ }
+#endif
result->value.value = create_implicit_cast(expression, type);
return result;
value->base.type = revert_automatic_type_conversion(value);
type_t *orig_type = value->base.type;
- if (!is_type_valid(orig_type))
+ if (!is_type_valid(skip_typeref(orig_type)))
return;
set_address_taken(value, false);
/* This check does not prevent the error message in all cases of an
* prior error while parsing the expression. At least it catches the
* common case of a mistyped enum entry. */
- if (is_type_valid(expression->base.type)) {
+ if (is_type_valid(skip_typeref(expression->base.type))) {
errorf(pos, "case label does not reduce to an integer constant");
}
statement->case_label.is_bad = true;
/* This check does not prevent the error message in all cases of an
* prior error while parsing the expression. At least it catches the
* common case of a mistyped enum entry. */
- if (is_type_valid(end_range->base.type)) {
+ if (is_type_valid(skip_typeref(end_range->base.type))) {
errorf(pos, "case range does not reduce to an integer constant");
}
statement->case_label.is_bad = true;
eat(T_do);
- PUSH_PARENT(statement)
+ PUSH_PARENT(statement);
add_anchor_token(T_while);
statement->do_while.body = parse_loop_body(statement);