fix(compiler): Take care of program with no input when creating client parameters

This commit is contained in:
Quentin Bourgerie
2022-02-11 15:00:33 +01:00
committed by Quentin Bourgerie
parent 1f3944047f
commit 3330b2f855

View File

@@ -143,9 +143,14 @@ createClientParametersForV0(V0FHEContext fheContext,
// Create input and output circuit gate parameters
auto funcType = (*funcOp).getType();
bool hasContext = funcType.getInputs()
.back()
.isa<mlir::concretelang::Concrete::ContextType>();
auto inputs = funcType.getInputs();
bool hasContext =
inputs.empty()
? false
: inputs.back().isa<mlir::concretelang::Concrete::ContextType>();
for (auto inType = funcType.getInputs().begin();
inType < funcType.getInputs().end() - hasContext; inType++) {
auto gate =