You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I noticed that when using the flow optimization, nested if statements can cause the compiler to throw a syntax error.
Here is an example program that triggers the error:
a = 1
if True:
if True:
a = 2
if True:
a = 3
else:
a = 4
Compiling this with ./compile.py -l program results in the following output:
Default bit length for compilation: 64
Default security parameter for compilation: 40
Compiling file Programs/Source/program.mpc
Traceback (most recent call last):
File "MP-SPDZ/./compile.py", line 41, in <module>
main(compiler)
File "MP-SPDZ/./compile.py", line 36, in main
compilation(compiler)
File "MP-SPDZ/./compile.py", line 19, in compilation
prog = compiler.compile_file()
^^^^^^^^^^^^^^^^^^^^^^^
File "MP-SPDZ/Compiler/compilerLib.py", line 479, in compile_file
exec(compile(infile.read(), infile.name, "exec"), self.VARS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmph9_6ft_w", line 10
else:
^^^^
SyntaxError: invalid syntax
Compiling without -l or removing one of the inner if statements fixes the problem.
Thanks for looking into this!
The text was updated successfully, but these errors were encountered:
Hi, I noticed that when using the flow optimization, nested if statements can cause the compiler to throw a syntax error.
Here is an example program that triggers the error:
Compiling this with
./compile.py -l program
results in the following output:Compiling without
-l
or removing one of the inner if statements fixes the problem.Thanks for looking into this!
The text was updated successfully, but these errors were encountered: