From 690cdfc552f528357e7656d97810b5e409739523 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 21 Jun 2011 14:20:27 +0200 Subject: [PATCH] Reduce code duplication. The duplicate contained a bug, of course: The shown position was wrong. --- parser.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/parser.c b/parser.c index ef08abd..8edfee5 100644 --- 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, -- 2.20.1