NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
285 stars 48 forks source link

[Possible bug] Nested "if" fails assertion "(stack_size - 1) == call_stack.size()" #527

Closed CblPOK-git closed 7 months ago

CblPOK-git commented 7 months ago

Example `using namespace nil::crypto3::algebra::curves;

[[circuit]] typename pallas::base_field_type::value_type field_arithmetic_example(typename pallas::base_field_type::value_type a, typename pallas::base_field_type::value_type b) {

    if (a <= b) {
        if (a == b) {
            return a + b;
        }
        else {
            return a - b;
        }
    }
    if (a >= b) {
        if (a > b) {
            return a * b;
        }
        else {
            return a / b;
        }
    }

}`