Quellcode durchsuchen

fix missing type checking for compiler

narodnik vor 5 Jahren
Ursprung
Commit
147d099596
1 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen
  1. 10 5
      scripts/pism.py

+ 10 - 5
scripts/pism.py

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