From 378e7fd330d9b0328fd2d20f6edab9006eb43dd3 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 30 Jan 2009 21:35:30 +0000 Subject: Fix horrible non-termination bug in LiveVariables. The issue was that the liveness state of block-level expressions could oscillate because of two issues: - The initial value before a merge was not always set to "Top" - The set of live block-level expressions is a union, not an intersection This fixes . llvm-svn: 63421 --- clang/lib/Analysis/LiveVariables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Analysis/LiveVariables.cpp') diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index 4c86d44..23f6f46 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -130,7 +130,7 @@ public: void VisitTerminator(CFGBlock* B); void SetTopValue(LiveVariables::ValTy& V) { - V = AD.AlwaysLive; + V = AD.AlwaysLive; } }; @@ -300,7 +300,7 @@ struct Merge { void operator()(ValTy& Dst, const ValTy& Src) { Dst.OrDeclBits(Src); - Dst.AndBlkExprBits(Src); + Dst.OrBlkExprBits(Src); } }; -- cgit v1.1