mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 03:13:13 +01:00
Fix return type of OrOr and AndAndExp being set incorrectly if rhs is void. Thanks wilsonk!
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user