diff --git a/compiler/python/CompilerAPIModule.cpp b/compiler/python/CompilerAPIModule.cpp index f9a0339c4..b64e04040 100644 --- a/compiler/python/CompilerAPIModule.cpp +++ b/compiler/python/CompilerAPIModule.cpp @@ -46,7 +46,7 @@ void zamalang::python::populateCompilerAPISubmodule(pybind11::module &m) { .def("run", [](CompilerEngine &engine, std::vector args) { auto result = engine.run(args); - if (!result) { + if (!result) { // not an error llvm::errs() << "Execution failed: " << result.takeError() << "\n"; throw std::runtime_error( @@ -56,9 +56,9 @@ void zamalang::python::populateCompilerAPISubmodule(pybind11::module &m) { }) .def("compile_fhe", [](CompilerEngine &engine, std::string mlir_input) { - auto result = engine.compile(mlir_input); - if (!result) { - llvm::errs() << "Compilation failed: " << result << "\n"; + auto error = engine.compile(mlir_input); + if (error) { + llvm::errs() << "Compilation failed: " << error << "\n"; throw std::runtime_error( "failed compiling, see previous logs for more info"); }