Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch 
into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/87606

during destruction, var_decl_expr must remove itself from associated var_expr
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/87606
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/script_exprs.cpp'
--- src/compiler/expression/script_exprs.cpp	2012-01-03 13:04:30 +0000
+++ src/compiler/expression/script_exprs.cpp	2012-01-05 12:26:33 +0000
@@ -264,6 +264,15 @@
 }
 
 
+var_decl_expr::~var_decl_expr()
+{
+  // Note: var_expr objs for global vars live longer than their associated
+  // var_decl_expr, because such var_expr objs are also registered in the sctx.
+  if (theInitExpr)
+    theVarExpr->remove_set_expr(this);
+}
+
+
 void var_decl_expr::serialize(::zorba::serialization::Archiver& ar)
 {
   serialize_baseclass(ar, (expr*)this);

=== modified file 'src/compiler/expression/script_exprs.h'
--- src/compiler/expression/script_exprs.h	2012-01-03 13:04:30 +0000
+++ src/compiler/expression/script_exprs.h	2012-01-05 12:26:33 +0000
@@ -246,6 +246,8 @@
       const var_expr_t& varExpr,
       const expr_t& initExpr);
 
+  ~var_decl_expr();
+
   var_expr* get_var_expr() const { return theVarExpr.getp(); }
 
   expr* get_init_expr() const { return theInitExpr.getp(); }

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to