Reduce code duplication.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 21 Jun 2011 12:20:27 +0000 (14:20 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 21 Jun 2011 13:53:48 +0000 (15:53 +0200)
The duplicate contained a bug, of course: The shown position was wrong.

parser.c

index ef08abd..8edfee5 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -7665,13 +7665,10 @@ end_error:;
                        }
                        result_type = pointer_type;
                } else {
-                       if (is_type_valid(other_type)) {
-                               type_error_incompatible("while parsing conditional",
-                                               &expression->base.source_position, true_type, false_type);
-                       }
-                       result_type = type_error_type;
+                       goto types_incompatible;
                }
        } else {
+types_incompatible:
                if (is_type_valid(true_type) && is_type_valid(false_type)) {
                        type_error_incompatible("while parsing conditional",
                                                &conditional->base.source_position, true_type,