Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
misonijnik committed Aug 21, 2024
1 parent 9c2d235 commit c691dbe
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
6 changes: 1 addition & 5 deletions lib/Core/ExternalDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,13 @@ Function *ExternalDispatcherImpl::createDispatcher(KCallable *target,

llvm::IRBuilder<> Builder(dBB);
// Get a Value* for &gTheArgsP, as an i64**.
#if LLVM_VERSION_CODE >= LLVM_VERSION(15, 0)
auto argI64sp = Builder.CreateIntToPtr(
ConstantInt::get(Type::getInt64Ty(ctx), (uintptr_t)&gTheArgsP),
PointerType::getUnqual(PointerType::getUnqual(Type::getInt64Ty(ctx))),
"argsp");
#if LLVM_VERSION_CODE >= LLVM_VERSION(15, 0)
auto argI64s = Builder.CreateLoad(Builder.getPtrTy(), argI64sp, "args");
#else
auto argI64sp = Builder.CreateIntToPtr(
ConstantInt::get(Type::getInt64Ty(ctx), (uintptr_t)(void *)&gTheArgsP),
PointerType::getUnqual(PointerType::getUnqual(Type::getInt64Ty(ctx))),
"argsp");
auto argI64s = Builder.CreateLoad(
argI64sp->getType()->getPointerElementType(), argI64sp, "args");
#endif
Expand Down
4 changes: 2 additions & 2 deletions lib/Core/SpecialFunctionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ SpecialFunctionHandler::SpecialFunctionHandler(Executor &_executor)

void SpecialFunctionHandler::prepare(
std::vector<const char *> &preservedFunctions) {
for (auto &hi : handlerInfo) {
for (const auto &hi : handlerInfo) {
Function *f = executor.kmodule->module->getFunction(hi.name);

// No need to create if the function doesn't exist, since it cannot
Expand All @@ -227,7 +227,7 @@ void SpecialFunctionHandler::prepare(
}

void SpecialFunctionHandler::bind() {
for (auto &hi : handlerInfo) {
for (const auto &hi : handlerInfo) {
Function *f = executor.kmodule->module->getFunction(hi.name);

if (f && (!hi.doNotOverride || f->isDeclaration())) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Solver/STPSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ std::string STPSolverImpl::getConstraintLog(const Query &query) {
vc_printQueryStateToBuffer(vc, builder->getFalse(), &buffer, &length, false);
vc_pop(vc);

std::string result = buffer;
std::string result(buffer);
std::free(buffer);

return result;
Expand Down
2 changes: 1 addition & 1 deletion runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ foreach (bc_architecture ${bc_architectures})
elseif (bc_optimization STREQUAL "Release+Debug+Asserts")
list(APPEND local_flags -O2 -g -D_DEBUG)
elseif (bc_optimization STREQUAL "Debug")
list(APPEND local_flags -g -D_DEBUG -DNDEBUG)
list(APPEND local_flags -g -D_DEBUG --fpermissive)
elseif (bc_optimization STREQUAL "Debug+Asserts")
list(APPEND local_flags -g -D_DEBUG)
else()
Expand Down
6 changes: 2 additions & 4 deletions tools/kleaver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ add_executable(kleaver
llvm_config(kleaver "${USE_LLVM_SHARED}" core support)

target_link_libraries(kleaver PRIVATE kleaverSolver)
target_include_directories(klee SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
target_include_directories(klee PRIVATE ${KLEE_INCLUDE_DIRS})
target_include_directories(kleaver SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
target_include_directories(kleaver PRIVATE ${KLEE_INCLUDE_DIRS})
target_compile_options(kleaver PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
target_compile_definitions(kleaver PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})

target_compile_definitions(kleaver PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})


install(TARGETS kleaver RUNTIME DESTINATION bin)
3 changes: 2 additions & 1 deletion unittests/Searcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ target_include_directories(SearcherTest BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/lib"
target_compile_options(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
target_compile_definitions(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})

target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS} ${SQLite3_INCLUDE_DIRS})
target_include_directories(SearcherTest SYSTEM PRIVATE ${SQLite3_INCLUDE_DIRS})
target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS})

0 comments on commit c691dbe

Please sign in to comment.