From 928784d387e55381aa407dc168bcf422dc40a69c Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 3 Aug 2009 00:32:34 +0000 Subject: Fix computation of GetElementPtr offset for 64-bit targets. - Precomputed constants were being truncated to 32-bits! - This was actually the problem with new[]/delete[], I failed to look at the generated code for new[] to realize that the compiler is generating the offset pointer, not the runtime library. - All tests now pass on x86-64! git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77930 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/klee/Internal/Module/KInstruction.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/klee/Internal/Module/KInstruction.h b/include/klee/Internal/Module/KInstruction.h index c91d37ab..89b9dbfc 100644 --- a/include/klee/Internal/Module/KInstruction.h +++ b/include/klee/Internal/Module/KInstruction.h @@ -10,6 +10,7 @@ #ifndef KLEE_KINSTRUCTION_H #define KLEE_KINSTRUCTION_H +#include "llvm/Support/DataTypes.h" #include namespace llvm { @@ -41,8 +42,15 @@ namespace klee { }; struct KGEPInstruction : KInstruction { - std::vector< std::pair > indices; - unsigned offset; + /// indices - The list of variable sized adjustments to add to the pointer + /// operand to execute the instruction. The first element is the operand + /// index into the GetElementPtr instruction, and the second element is the + /// element size to multiple that index by. + std::vector< std::pair > indices; + + /// offset - A constant offset to add to the pointer operand to execute the + /// insturction. + uint64_t offset; }; } -- cgit 1.4.1