fix backward propagateSideEffect impl
[xonotic/gmqcc.git] / ast.cpp
diff --git a/ast.cpp b/ast.cpp
index 58ed6603b881be4b3c635eac09c31ab3daa1d980..96d9e2fd07828456414e4556ed31231320d775f4 100644 (file)
--- 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 */