changeset 197:b8c907304254

editor_info: runs the range_analysis in a more sane way
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 16 Dec 2009 17:22:25 +0100
parents 14bb029606f9
children 658c9583c9e9
files pysmcl/editor_info.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/editor_info.py	Wed Dec 16 16:57:11 2009 +0100
+++ b/pysmcl/editor_info.py	Wed Dec 16 17:22:25 2009 +0100
@@ -25,7 +25,7 @@
             t = transform_ifs.visit(i)
             while transform_ifs.changed:
                 secret_analysis(i)
-#                RangeAnalysis(pysmcl.setup.Zp.modulus).apply(i, {})
+                RangeAnalysis(pysmcl.setup.Zp.modulus).apply(i, {})
                 transform_ifs.reset()
                 t = transform_ifs.visit(i)
             secret_analysis(i)
@@ -41,6 +41,8 @@
                 continue
 
             for statement in top_level_statement.body:
+                if getattr(statement, "is_syntetic", False):
+                    continue
                 for j in ast.walk(statement):
                     if isinstance(j, ast.stmt):
                         e = j.out_values["secret"]
@@ -51,9 +53,7 @@
                             print "!secret: %d %d %d (%s)" % (j.lineno, j.col_offset,
                                                 len(s), s)
                     if(isinstance(j, ast.Name) and not 
-                       (isinstance(j.parent, ast.Call) and j is j.parent.func) and
-                       r and
-                       j.id in r):
+                       (isinstance(j.parent, ast.Call) and j is j.parent.func)):
 
                         print "!values: %d %d %d (%s)" % (j.lineno, j.col_offset,
                                                 len(pp.expr_string(j)), j.id + " is in " +str(r[j.id]))