From 0283175fdda6bf4dbd9343b53987d0aee01ce9fc Mon Sep 17 00:00:00 2001 From: Lukas Wölfer Date: Mon, 27 Aug 2018 00:51:03 +0200 Subject: Implemented memalign with alignment --- lib/Core/Executor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index e4f9388e..7cb01e5c 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -3286,11 +3286,14 @@ void Executor::executeAlloc(ExecutionState &state, bool isLocal, KInstruction *target, bool zeroMemory, - const ObjectState *reallocFrom) { + const ObjectState *reallocFrom, + size_t allocationAlignment) { size = toUnique(state, size); if (ConstantExpr *CE = dyn_cast(size)) { const llvm::Value *allocSite = state.prevPC->inst; - size_t allocationAlignment = getAllocationAlignment(allocSite); + if (allocationAlignment == 0) { + allocationAlignment = getAllocationAlignment(allocSite); + } MemoryObject *mo = memory->allocate(CE->getZExtValue(), isLocal, /*isGlobal=*/false, allocSite, allocationAlignment); -- cgit 1.4.1