mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-21 13:50:05 +02: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();
|
e2 = e2->checkToPointer();
|
||||||
|
|
||||||
type = Type::tboolean;
|
type = Type::tboolean;
|
||||||
if (e1->type->ty == Tvoid)
|
if (e2->type->ty == Tvoid)
|
||||||
type = Type::tvoid;
|
type = Type::tvoid;
|
||||||
if (e2->op == TOKtype || e2->op == TOKimport)
|
if (e2->op == TOKtype || e2->op == TOKimport)
|
||||||
error("%s is not an expression", e2->toChars());
|
error("%s is not an expression", e2->toChars());
|
||||||
@@ -8658,7 +8658,7 @@ Expression *AndAndExp::semantic(Scope *sc)
|
|||||||
e2 = e2->checkToPointer();
|
e2 = e2->checkToPointer();
|
||||||
|
|
||||||
type = Type::tboolean;
|
type = Type::tboolean;
|
||||||
if (e1->type->ty == Tvoid)
|
if (e2->type->ty == Tvoid)
|
||||||
type = Type::tvoid;
|
type = Type::tvoid;
|
||||||
if (e2->op == TOKtype || e2->op == TOKimport)
|
if (e2->op == TOKtype || e2->op == TOKimport)
|
||||||
error("%s is not an expression", e2->toChars());
|
error("%s is not an expression", e2->toChars());
|
||||||
|
|||||||
Reference in New Issue
Block a user