literals are always 'nonlocally immutable'
authorStefan Behnel <stefan_ml@behnel.de>
Fri, 28 Sep 2012 17:38:50 +0000 (19:38 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Fri, 28 Sep 2012 17:38:50 +0000 (19:38 +0200)
Cython/Compiler/ExprNodes.py

index 6face90..1ea055e 100755 (executable)
@@ -389,7 +389,7 @@ class ExprNode(Node):
     def nonlocally_immutable(self):
         # Returns whether this variable is a safe reference, i.e.
         # can't be modified as part of globals or closures.
-        return self.is_temp or self.type.is_array or self.type.is_cfunction
+        return self.is_literal or self.is_temp or self.type.is_array or self.type.is_cfunction
 
     # --------------- Type Analysis ------------------