From 6f5537fc9080c03bc1c9f7e8e0d6bb93c5b03e2d Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 15 Jan 2018 10:35:19 +0100 Subject: llvm5: avoid ++ on function->arg_begin() Starting with llvm 5, arguments of a function are not an iterator, but an array. So they cannot be incremented in-place. Add a local auto variable and increment that. Otherwise we see: ../tools/klee/main.cpp:661:23: error: expression is not assignable Value *oldArgv = &*(++mainFn->arg_begin()); ^ ~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jiri Slaby --- tools/klee/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 4b32c00b..0cbeaa96 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -1032,7 +1032,8 @@ createLibCWrapper(std::vector> &modules, args.push_back( llvm::ConstantExpr::getBitCast(inModuleRefernce, ft->getParamType(0))); args.push_back(&*(stub->arg_begin())); // argc - args.push_back(&*(++stub->arg_begin())); // argv + auto arg_it = stub->arg_begin(); + args.push_back(&*(++arg_it)); // argv args.push_back(Constant::getNullValue(ft->getParamType(3))); // app_init args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini -- cgit 1.4.1