diff dmd/expression.c @ 779:ef7fe998f9b3

Fix return type of OrOr and AndAndExp being set incorrectly if rhs is void. Thanks wilsonk!
author Christian Kamm <kamm incasoftware de>
date Sat, 22 Nov 2008 18:38:13 +0100
parents 55f6c2e454d7
children 661384d6a936
line wrap: on
line diff
--- a/dmd/expression.c	Sat Nov 22 18:35:52 2008 +0100
+++ b/dmd/expression.c	Sat Nov 22 18:38:13 2008 +0100
@@ -8593,7 +8593,7 @@
     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 @@
     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());