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

cast lhs

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