changeset 216:7c32c0b6bc39

secret_analysis: handle for
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 23 Dec 2009 14:31:42 +0100
parents 98957794e778
children 121f28df6811
files pysmcl/secret_annotator.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/secret_annotator.py	Wed Dec 23 14:31:26 2009 +0100
+++ b/pysmcl/secret_annotator.py	Wed Dec 23 14:31:42 2009 +0100
@@ -99,6 +99,17 @@
                 ins = ins | set([name])
         else:
             ins = ins - set([name])
+    if(isinstance(node, ast.For)):
+        target = node.target
+        if(isinstance(target, ast.Name)):
+            name = target.id
+        else:
+            error(node, "Unhandled type of for loop")
+        if(expr_secret(node.iter, ins)):
+            ins = ins | set([name])
+        else:
+            ins = ins - set([name])
+        
 
     if(isinstance(node, ast.Expr)):
            expr_secret(node.value, ins)