Skip to content

Commit

Permalink
Renamed --red-zone-space to --redzone-size and improved help message
Browse files Browse the repository at this point in the history
  • Loading branch information
ccadar authored and MartinNowack committed Mar 13, 2019
1 parent 1231f8c commit bf008fc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Core/MemoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ llvm::cl::opt<bool> NullOnZeroMalloc(
llvm::cl::desc("Returns NULL if malloc(0) is called (default=false)"),
llvm::cl::init(false), llvm::cl::cat(MemoryCat));

llvm::cl::opt<unsigned> RedZoneSpace(
"red-zone-space",
llvm::cl::desc("Set the amount of free space between allocations. This is "
"important to detect out-of-bounds accesses (default=10)"),
llvm::cl::opt<unsigned> RedzoneSize(
"redzone-size",
llvm::cl::desc("Set the size of the redzones to be added after each "
"allocation (in bytes). This is important to detect "
"out-of-bounds accesses (default=10)"),
llvm::cl::init(10), llvm::cl::cat(MemoryCat));

llvm::cl::opt<unsigned long long> DeterministicStartAddress(
Expand Down Expand Up @@ -125,7 +126,7 @@ MemoryObject *MemoryManager::allocate(uint64_t size, bool isLocal,
// This way, we make sure we have this allocation between its own red zones
size_t alloc_size = std::max(size, (uint64_t)1);
if ((char *)address + alloc_size < deterministicSpace + spaceSize) {
nextFreeSlot = (char *)address + alloc_size + RedZoneSpace;
nextFreeSlot = (char *)address + alloc_size + RedzoneSize;
} else {
klee_warning_once(0, "Couldn't allocate %" PRIu64
" bytes. Not enough deterministic space left.",
Expand Down

0 comments on commit bf008fc

Please sign in to comment.