Skip to content

Commit fa2ea9c

Browse files
Add missing update field for some passes
1 parent 9010c2d commit fa2ea9c

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

pythran/transformations/expand_globals.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def visit_Module(self, node):
9999
self.ctx)
100100
module_body.append(self.visit(stmt))
101101

102+
self.update |= bool(self.to_expand)
103+
102104
node.body = module_body
103105
return node
104106

@@ -112,6 +114,7 @@ def visit_Name(self, node):
112114
if (isinstance(node.ctx, ast.Load) and
113115
node.id not in self.local_decl and
114116
node.id in self.to_expand):
117+
self.update = True
115118
return ast.Call(func=node,
116119
args=[], keywords=[])
117120
return node

pythran/transformations/normalize_is_none.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def visit_BoolOp(self, node):
7676
values = list(node.values)
7777
self.generic_visit(node)
7878
if any(x != y for x, y in zip(values, node.values)):
79+
self.update = True
7980
return reduce(lambda x, y:
8081
ast.BinOp(x,
8182
NormalizeIsNone.table[type(node.op)](), y),
@@ -99,6 +100,8 @@ def visit_Compare(self, node):
99100
ast.Load()),
100101
[noned_var], [])
101102

103+
self.update = True
104+
102105
if negated:
103106
return ast.UnaryOp(ast.Not(), call)
104107
else:

pythran/transformations/normalize_static_if.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def visit_If(self, node):
177177
expected_return = [ast.Name(ii, ast.Load(), None)
178178
for ii in assigned_ids]
179179

180+
self.update = True
181+
180182
if has_return:
181183
n = len(self.new_functions)
182184
fast_return = [ast.Name("$status{}".format(n), ast.Load(), None),
@@ -321,6 +323,7 @@ def has_static_expression(n):
321323
raise PythranSyntaxError("operator not supported in a static if",
322324
node)
323325

326+
self.update = True
324327
return self.visit(node)
325328

326329
visit_If = visit_IfExp = visit_Cond

0 commit comments

Comments
 (0)