Skip to content
Snippets Groups Projects
Commit f449abb7 authored by Daniel Bauer's avatar Daniel Bauer :speech_balloon:
Browse files

cast lhs

parent 50fbc0a9
No related branches found
No related tags found
1 merge request!381Do not hoist declarations of mutated variables
...@@ -176,9 +176,8 @@ class HoistLoopInvariantDeclarations: ...@@ -176,9 +176,8 @@ class HoistLoopInvariantDeclarations:
for node in block.statements: for node in block.statements:
if isinstance(node, PsDeclaration): if isinstance(node, PsDeclaration):
if node.lhs.symbol not in hc.mutated_symbols and hc._is_invariant( lhs_symb = cast(PsSymbolExpr, node.lhs).symbol
node.rhs if lhs_symb not in hc.mutated_symbols and hc._is_invariant(node.rhs):
):
hc.hoisted_nodes.append(node) hc.hoisted_nodes.append(node)
hc.invariant_symbols.add(node.declared_symbol) hc.invariant_symbols.add(node.declared_symbol)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment