From 73c6c128af218437b40f1e06749b41723e0dd662 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Fri, 31 Dec 2010 02:40:53 +0000 Subject: [PATCH] Fix the build. The speedup in the prior checkin needs these too. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1041 e59a4935-1847-0410-ae03-e826735625c1 --- src/AST/ASTBVConst.cpp | 2 ++ src/AST/ASTBVConst.h | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/AST/ASTBVConst.cpp b/src/AST/ASTBVConst.cpp index 8fd0e64..dae19e2 100644 --- a/src/AST/ASTBVConst.cpp +++ b/src/AST/ASTBVConst.cpp @@ -21,6 +21,7 @@ namespace BEEV { _bvconst = CONSTANTBV::BitVector_Clone(bv); _value_width = width; + cbv_managed_outside =false; } //End of ASTBVConst constructor // Copy constructor. @@ -29,6 +30,7 @@ namespace BEEV { _bvconst = CONSTANTBV::BitVector_Clone(sym._bvconst); _value_width = sym._value_width; + cbv_managed_outside =false; } //End of copy constructor() // Call this when deleting a node that has been stored in the the diff --git a/src/AST/ASTBVConst.h b/src/AST/ASTBVConst.h index 3f29dd7..32cba9a 100644 --- a/src/AST/ASTBVConst.h +++ b/src/AST/ASTBVConst.h @@ -34,7 +34,10 @@ namespace BEEV //CBV is actually an unsigned*. The bitvector constant is //represented using an external library in extlib-bvconst. CBV _bvconst; - + + // If the CBV is managed outside of this class. Then a defensive copy isn't taken. + bool cbv_managed_outside; + /**************************************************************** * Class ASTBVConstHasher: * * * @@ -46,6 +49,8 @@ namespace BEEV size_t operator()(const ASTBVConst * bvc) const; }; //End of class ASTBVConstHahser + + /**************************************************************** * Class ASTBVConstEqual: * * * @@ -61,9 +66,20 @@ namespace BEEV /**************************************************************** * Private Functions (virtual defs and friends) * ****************************************************************/ + //Constructor ASTBVConst(CBV bv, unsigned int width); + enum CBV_LIFETIME {CBV_MANAGED_OUTSIDE}; + + ASTBVConst(CBV bv, unsigned int width, enum CBV_LIFETIME l ) + : ASTInternal(BVCONST) + { + _bvconst = (bv); + _value_width = width; + cbv_managed_outside =true; + } + // Copy constructor. ASTBVConst(const ASTBVConst &sym); @@ -94,7 +110,8 @@ namespace BEEV //Destructor. Call the external destructor virtual ~ASTBVConst() { - CONSTANTBV::BitVector_Destroy(_bvconst); + if (!cbv_managed_outside) + CONSTANTBV::BitVector_Destroy(_bvconst); } //End of destructor // Return the bvconst. It is a const-value -- 2.47.3