]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Bugfix. Memory was sometimes read after it had been freed by the garbage collector
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Sat, 28 Aug 2010 12:57:55 +0000 (12:57 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Sat, 28 Aug 2010 12:57:55 +0000 (12:57 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1004 e59a4935-1847-0410-ae03-e826735625c1

src/AST/ArrayTransformer.cpp

index 6b85311b9d33e8ad6cc30bd16c3bda23b3bc3b1c..f3b0daebec218b5aa924e3ef7892227b9f7bd729 100644 (file)
@@ -450,7 +450,11 @@ namespace BEEV
               || SBVREM == k 
               || SBVMOD == k)
             {
-              const ASTNode& bottom = result[1];
+
+              // I had this as a reference, but that was wrong. Because
+              // "result" gets over-written in the next block, result[1], may
+              // get a reference count of zero, so be garbage collected.
+              const ASTNode bottom = result[1];
 
               if (SBVDIV == result.GetKind() 
                   || SBVREM == result.GetKind()