Skip to content

Commit 6cab44b

Browse files
committed
llvm-14 fixes
1 parent ba0a8c1 commit 6cab44b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/Core/MockBuilder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ void MockBuilder::buildCallKleeMakeSymbolic(
167167
auto bitCastInst = builder->CreateBitCast(
168168
source, llvm::Type::getInt8PtrTy(mockModule->getContext()));
169169
auto globalSymbolicName = builder->CreateGlobalString("@" + symbolicName);
170-
auto gep = builder->CreateConstInBoundsGEP2_64(globalSymbolicName, 0, 0);
170+
auto gep = builder->CreateConstInBoundsGEP2_64(
171+
globalSymbolicName->getValueType(), globalSymbolicName, 0, 0);
171172
builder->CreateCall(
172173
kleeMakeSymbolicCallee,
173174
{bitCastInst,
@@ -198,7 +199,8 @@ MockBuilder::goByOffset(llvm::Value *value,
198199
current->getType()->isArrayTy())) {
199200
klee_error("Incorrect annotation offset.");
200201
}
201-
current = builder->CreateConstInBoundsGEP1_64(current, index);
202+
current = builder->CreateConstInBoundsGEP1_64(current->getType(), current,
203+
index);
202204
}
203205
}
204206
return current;

test/Replay/libkleeruntest/replay_mocks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: %clang %s -emit-llvm -g %O0opt -c -o %t.bc
33
// RUN: rm -rf %t.klee-out
44
// RUN: %klee --output-dir=%t.klee-out --external-calls=all --mock-strategy=naive %t.bc
5+
56
// RUN: %clang -c %t.bc -o %t.o
67
// RUN: %llvmobjcopy --redefine-syms %t.klee-out/redefinitions.txt %t.o
78
// RUN: %clang -o %t.klee-out/a.out %libkleeruntest %t.klee-out/externals.ll %t.o

0 commit comments

Comments
 (0)