From ac28509bdedba3f19ccd6cd3cd7119d097fcf8d9 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sat, 22 Nov 2008 18:38:13 +0100 Subject: [PATCH] Fix return type of OrOr and AndAndExp being set incorrectly if rhs is void. Thanks wilsonk! --- dmd/expression.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmd/expression.c b/dmd/expression.c index 70fb82fa..d866fc37 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -8593,7 +8593,7 @@ Expression *OrOrExp::semantic(Scope *sc) e2 = e2->checkToPointer(); type = Type::tboolean; - if (e1->type->ty == Tvoid) + if (e2->type->ty == Tvoid) type = Type::tvoid; if (e2->op == TOKtype || e2->op == TOKimport) error("%s is not an expression", e2->toChars()); @@ -8658,7 +8658,7 @@ Expression *AndAndExp::semantic(Scope *sc) e2 = e2->checkToPointer(); type = Type::tboolean; - if (e1->type->ty == Tvoid) + if (e2->type->ty == Tvoid) type = Type::tvoid; if (e2->op == TOKtype || e2->op == TOKimport) error("%s is not an expression", e2->toChars());