Skip to content

Commit

Permalink
mock external objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelaiwo authored and misonijnik committed Nov 11, 2022
1 parent a7a0beb commit f31030a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,13 @@ void Executor::initializeGlobalObjects(ExecutionState &state) {
addr = externalDispatcher->resolveSymbol(v.getName().str());
}
if (!addr) {
klee_error("Unable to load symbol(%.*s) while initializing globals",
static_cast<int>(v.getName().size()), v.getName().data());
}
for (unsigned offset = 0; offset < mo->size; offset++) {
os->write8(offset, static_cast<unsigned char *>(addr)[offset]);
executeMakeSymbolic(state, mo,
typeSystemManager->getWrappedType(v.getType()),
"mocked_extern", false);
} else {
for (unsigned offset = 0; offset < mo->size; offset++) {
os->write8(offset, static_cast<unsigned char *>(addr)[offset]);
}
}
} else if (v.hasInitializer()) {
initializeGlobalObject(state, os, v.getInitializer(), 0);
Expand Down

0 comments on commit f31030a

Please sign in to comment.