diff --git a/compiler/lib/Support/V0ClientParameters.cpp b/compiler/lib/Support/V0ClientParameters.cpp index a313aa12c..ffd584032 100644 --- a/compiler/lib/Support/V0ClientParameters.cpp +++ b/compiler/lib/Support/V0ClientParameters.cpp @@ -143,9 +143,14 @@ createClientParametersForV0(V0FHEContext fheContext, // Create input and output circuit gate parameters auto funcType = (*funcOp).getType(); - bool hasContext = funcType.getInputs() - .back() - .isa(); + + auto inputs = funcType.getInputs(); + + bool hasContext = + inputs.empty() + ? false + : inputs.back().isa(); + for (auto inType = funcType.getInputs().begin(); inType < funcType.getInputs().end() - hasContext; inType++) { auto gate =