From: Wolfgang Bumiller Date: Sun, 1 Feb 2015 11:12:25 +0000 (+0100) Subject: fix backward propagateSideEffect impl X-Git-Tag: xonotic-v0.8.2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=896d4c53a39c029fb35c861351a0a07868c30f4b;p=xonotic%2Fgmqcc.git fix backward propagateSideEffect impl --- diff --git a/ast.cpp b/ast.cpp index 58ed660..96d9e2f 100644 --- a/ast.cpp +++ b/ast.cpp @@ -24,9 +24,10 @@ ast_node::~ast_node() } /* weight and side effects */ -void ast_node::propagateSideEffects(ast_node *other) const +void ast_node::propagateSideEffects(const ast_node *other) { - other->m_side_effects = m_side_effects; + if (other->m_side_effects) + m_side_effects = true; } /* General expression initialization */ diff --git a/ast.h b/ast.h index 04f8c0e..b305dac 100644 --- a/ast.h +++ b/ast.h @@ -110,7 +110,7 @@ struct ast_node bool m_keep_node; bool m_side_effects; - void propagateSideEffects(ast_node *other) const; + void propagateSideEffects(const ast_node *other); }; #define ast_unref(x) do \