summaryrefslogtreecommitdiff
path: root/proofs
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-09-25 16:18:34 -0700
committerTim King <taking@google.com>2016-09-25 16:18:34 -0700
commit54461798bc0ae519ebe11cee370d42b58a2fecd2 (patch)
tree9bfed834652e18fd1763e4be87c02c561f8a3aa3 /proofs
parentb39f1f56b59dd7efeec99e0636b1a90245d1769c (diff)
Adding virtual destructors to several classes in expr.h .
Diffstat (limited to 'proofs')
-rw-r--r--proofs/lfsc_checker/expr.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/proofs/lfsc_checker/expr.h b/proofs/lfsc_checker/expr.h
index 5a505a3d9..a461e847c 100644
--- a/proofs/lfsc_checker/expr.h
+++ b/proofs/lfsc_checker/expr.h
@@ -88,7 +88,9 @@ protected:
: data(1 << 9 /* refcount 1, not cloned */| (_op << 3) | _class)
{ }
-public:
+ public:
+ virtual ~Expr() {}
+
static int markedCount;
inline Expr* followDefs();
inline int getclass() const { return data & 7; }
@@ -181,7 +183,7 @@ public:
C_MACROS__ADD_CHUNKING_MEMORY_MANAGEMENT_H(CExpr,kids);
Expr **kids;
- ~CExpr() {
+ virtual ~CExpr() {
delete[] kids;
}
CExpr(int _op) : Expr(CEXPR, _op), kids() {
@@ -261,7 +263,7 @@ public:
class IntExpr : public Expr {
public:
mpz_t n;
- ~IntExpr() {
+ virtual ~IntExpr() {
mpz_clear(n);
}
IntExpr(mpz_t _n) : Expr(INT_EXPR, 0), n() {
@@ -280,7 +282,7 @@ class IntExpr : public Expr {
class RatExpr : public Expr {
public:
mpq_t n;
- ~RatExpr() {
+ virtual ~RatExpr() {
mpq_clear(n);
}
RatExpr(mpq_t _n) : Expr(RAT_EXPR, 0), n() {
@@ -321,6 +323,9 @@ class SymExpr : public Expr {
debugrefcnt(1,CREATE);
#endif
}
+
+ virtual ~SymExpr() {}
+
#ifdef MARKVAR_32
private:
int mark();
@@ -349,6 +354,8 @@ class SymSExpr : public SymExpr {
debugrefcnt(1,CREATE);
#endif
}
+
+ virtual ~SymSExpr() {}
};
class HoleExpr : public Expr {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback