From 0441388affe47d1219e1f37665844df7b0bdd657 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Jun 2004 06:29:59 +0000 Subject: [PATCH] Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on several mallocbench programs, including perl. llvm-svn: 14342 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index a15f3743d833..53c39f9047cc 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -825,8 +825,7 @@ DSNodeHandle ReachabilityCloner::getClonedNH(const DSNodeHandle &SrcNH) { unsigned MergeOffset = 0; DSNode *CN = NH.getNode(); if (CN->getSize() != 1) - MergeOffset = ((i << DS::PointerShift)+NH.getOffset() - - SrcNH.getOffset()) %CN->getSize(); + MergeOffset = ((i << DS::PointerShift)+NH.getOffset()) % CN->getSize(); CN->addEdgeTo(MergeOffset, DestEdge); } }