Browse Source

fix missing type checking for compiler

narodnik 5 years ago
parent
commit
147d099596
1 changed files with 10 additions and 5 deletions
  1. 10 5
      scripts/pism.py

+ 10 - 5
scripts/pism.py

@@ -55,7 +55,7 @@ command_desc = {
         ("EdwardsPoint",    False),
         ("EdwardsPoint",    False),
     ),
     ),
     "ec_get_u": (
     "ec_get_u": (
-        ("Scalar",          True),
+        ("ScalarNum",       True),
         ("EdwardsPoint",    False),
         ("EdwardsPoint",    False),
     ),
     ),
     "emit_ec": (
     "emit_ec": (
@@ -125,10 +125,10 @@ command_desc = {
         ("ScalarNum",       False),
         ("ScalarNum",       False),
     ),
     ),
     "conditionally_reverse": (
     "conditionally_reverse": (
-        ("Scalar",          True),
-        ("Scalar",          True),
-        ("Scalar",          False),
-        ("Scalar",          False),
+        ("ScalarNum",       True),
+        ("ScalarNum",       True),
+        ("ScalarNum",       False),
+        ("ScalarNum",       False),
         ("Boolean",         False),
         ("Boolean",         False),
     ),
     ),
 }
 }
@@ -370,6 +370,11 @@ use zcash_proofs::circuit::{ecc, pedersen_hash};
 
 
                 actual_type = self.stack[argname]
                 actual_type = self.stack[argname]
 
 
+            if expected_type != actual_type:
+                eprint("error: wrong type for arg '%s'!" % argname)
+                eprint(line)
+                return False
+
         return True
         return True
 
 
     def _check_args(self, command, args, line):
     def _check_args(self, command, args, line):