From c23fb91712f28b1f9f9f27dd01982921516caa31 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Sat, 28 Aug 2010 12:57:55 +0000 Subject: [PATCH] Bugfix. Memory was sometimes read after it had been freed by the garbage collector 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AST/ArrayTransformer.cpp b/src/AST/ArrayTransformer.cpp index 6b85311..f3b0dae 100644 --- a/src/AST/ArrayTransformer.cpp +++ b/src/AST/ArrayTransformer.cpp @@ -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() -- 2.47.3