From 7fdeb61aa848aaeb663d11ade92e045ac5583dfd Mon Sep 17 00:00:00 2001 From: Andi Drebes Date: Mon, 10 Jan 2022 16:54:48 +0100 Subject: [PATCH] fix(compiler): Handle size_t explicitly in JITLambdaArgumentAdaptor::addArgument On some systems, size_t does not alias any of the fixed-size, unsigned integer types and therefore needs to be treated explicitly in `JITLambdaArgumentAdaptor::addArgument` to prevent the function from failing with an unknown argument type. Closes issue #369: Bug: MacOS tests failing on master due to IntLambdaArgument. --- compiler/include/concretelang/Support/JitCompilerEngine.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/include/concretelang/Support/JitCompilerEngine.h b/compiler/include/concretelang/Support/JitCompilerEngine.h index ad59d8fec..45d0e2b9c 100644 --- a/compiler/include/concretelang/Support/JitCompilerEngine.h +++ b/compiler/include/concretelang/Support/JitCompilerEngine.h @@ -199,9 +199,12 @@ public: // to `jla` failed. static inline llvm::Error addArgument(JITLambda::Argument &jla, size_t pos, const LambdaArgument &arg) { + // Try the supported integer types; size_t needs explicit + // treatment, since it may alias none of the fixed size integer + // types llvm::Expected successOrError = JITLambdaArgumentAdaptor::tryAddArg(jla, pos, arg); + uint8_t, size_t>(jla, pos, arg); if (!successOrError) return std::move(successOrError.takeError());