changeset 185:6a37c03be33b

secret_if: better error messages
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 16 Dec 2009 14:44:37 +0100
parents b2ba68f717f8
children a2d0741e094b
files pysmcl/secret_ifs.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/secret_ifs.py	Wed Dec 16 14:29:37 2009 +0100
+++ b/pysmcl/secret_ifs.py	Wed Dec 16 14:44:37 2009 +0100
@@ -78,7 +78,7 @@
     def visit_While(self, node):
         if(pysmcl.secret_annotator.expr_secret(node.test)):
             error("It is not possible to have a while loop\
- with a secret condition", node)
+ with a secret condition", node.test)
         return node
 
     def do_body(self, body, suffix):
@@ -105,7 +105,7 @@
         if(pysmcl.secret_annotator.expr_secret(node.test)):
             range_visitor = RangeVisitor(pysmcl.setup.Zp.modulus, node.in_values["range"])
             if range_visitor.visit(node.test) != (0,1):
-                error("The condition cannot be proven to be in the range (0, 1)", node)
+                error("The condition cannot be proven to be in the range (0, 1)", node.test)
             self.changed = True
             replacement = []
             r_then = self.do_body(node.body, "_then")