From b71ddfd3d9bc02ee17da55a8672749fa4bab51d5 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 2 Aug 2009 23:09:31 +0000 Subject: Print allocation info for adjacent objects in out-of-bounds message. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77922 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Core/SpecialFunctionHandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Core/SpecialFunctionHandler.cpp') diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index 281bdc59..c23d626c 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -319,6 +319,9 @@ void SpecialFunctionHandler::handleNew(ExecutionState &state, void SpecialFunctionHandler::handleDelete(ExecutionState &state, KInstruction *target, std::vector > &arguments) { + // FIXME: Should check proper pairing with allocation type (malloc/free, + // new/delete, new[]/delete[]). + // XXX should type check args assert(arguments.size()==1 && "invalid number of arguments to delete"); executor.executeFree(state, arguments[0]); @@ -327,6 +330,8 @@ void SpecialFunctionHandler::handleDelete(ExecutionState &state, void SpecialFunctionHandler::handleNewArray(ExecutionState &state, KInstruction *target, std::vector > &arguments) { + // FIXME: This is broken, it doesn't allocate space for the count. + // XXX should type check args assert(arguments.size()==1 && "invalid number of arguments to new[]"); executor.executeAlloc(state, arguments[0], false, target); @@ -335,6 +340,8 @@ void SpecialFunctionHandler::handleNewArray(ExecutionState &state, void SpecialFunctionHandler::handleDeleteArray(ExecutionState &state, KInstruction *target, std::vector > &arguments) { + // FIXME: This is broken, it doesn't allocate space for the count. + // XXX should type check args assert(arguments.size()==1 && "invalid number of arguments to delete[]"); executor.executeFree(state, arguments[0]); -- cgit 1.4.1