From: Mikko Rasa Date: Sat, 6 Mar 2021 11:39:20 +0000 (+0200) Subject: Remove fallback from Assignment to BinaryExpression in TraversingVisitor X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=caa84a9d8adce6dc702f6e0ae32961b77a0a73ea;p=libs%2Fgl.git Remove fallback from Assignment to BinaryExpression in TraversingVisitor It's causing some trouble when the base class version is called for an assignment and it gets handled as a binary expression. Almost all classes are handling the two separately anyway. --- diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index 455a2d84..652ac252 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -88,6 +88,7 @@ private: virtual void visit(Block &); virtual void visit(UnaryExpression &); virtual void visit(BinaryExpression &); + virtual void visit(Assignment &a) { visit(static_cast(a)); } virtual void visit(MemberAccess &); virtual void visit(FunctionCall &); virtual void visit(ExpressionStatement &); diff --git a/source/glsl/visitor.cpp b/source/glsl/visitor.cpp index dad8badd..c740d118 100644 --- a/source/glsl/visitor.cpp +++ b/source/glsl/visitor.cpp @@ -39,7 +39,8 @@ void TraversingVisitor::visit(BinaryExpression &binary) void TraversingVisitor::visit(Assignment &assign) { - visit(static_cast(assign)); + assign.left->visit(*this); + assign.right->visit(*this); } void TraversingVisitor::visit(FunctionCall &call)