From daeac05883306ea055d1005c0aba6b957f3c4768 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 22 Apr 2026 13:18:01 +0200 Subject: [PATCH] Add return fix. --- .github/actions/compile-witness-generator/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/compile-witness-generator/action.yml b/.github/actions/compile-witness-generator/action.yml index 12ef161..6a12380 100644 --- a/.github/actions/compile-witness-generator/action.yml +++ b/.github/actions/compile-witness-generator/action.yml @@ -90,6 +90,13 @@ runs: CIRCUIT_CPP_PATH: ${{ steps.parse-circuit-path.outputs.CIRCUIT_CPP_PATH }} run: cp "${WITNESS_GENERATOR_RESOURCES_PATH}/Makefile" "${CIRCUIT_CPP_PATH}/Makefile" + # circom-generated main() has no return on the success path; patch it before -O3 turns it into an infinite loop + - name: Patch ${{ inputs.circuit-name-display }} Missing Return + shell: bash + env: + CIRCUIT_CPP_PATH: ${{ steps.parse-circuit-path.outputs.CIRCUIT_CPP_PATH }} + run: sed -i ':a;N;$!ba;s/\n}\n\n*$/\n return 0;\n}/' "${CIRCUIT_CPP_PATH}/main.cpp" + # TODO: Instead of insertion, make a fork that includes the appropriate patch (or the actual fix) - name: Patch MacOS GMP shell: bash