iden3 / circom

zkSnark circuit compiler
GNU General Public License v3.0
1.28k stars 244 forks source link

Move subcomponent counter decrease operation outside of assert #187

Closed OBrezhniev closed 1 year ago

OBrezhniev commented 1 year ago

In some cases asserts are disabled by cpp compiler and operation (subcomponent counter decrease) is not executed.

Fixes the problem with cpp witnesscalc reported here: https://github.com/0xPolygonID/witnesscalc/issues/4#issuecomment-1561302651

In general would be good to switch from asserts to exceptions I think.

clararod9 commented 1 year ago

Hi!

Thank you for your contribution and your suggestion :-)