Revision: 18186
Author:   [email protected]
Date:     Mon Dec  2 12:00:16 2013 UTC
Log:      Experimental parser: crash fix.

PreParser doesn't own its scanner_, Parser does. This is confusing, since both inherit from ParserBase which has the scanner_ member variable (-> to be fixed
later).

[email protected]
BUG=

Review URL: https://codereview.chromium.org/98933002
http://code.google.com/p/v8/source/detail?r=18186

Modified:
 /branches/experimental/parser/src/parser.h
 /branches/experimental/parser/src/preparser.h

=======================================
--- /branches/experimental/parser/src/parser.h  Mon Dec  2 11:45:18 2013 UTC
+++ /branches/experimental/parser/src/parser.h  Mon Dec  2 12:00:16 2013 UTC
@@ -414,6 +414,8 @@
   ~Parser() {
     delete reusable_preparser_;
     reusable_preparser_ = NULL;
+    delete scanner_;
+    scanner_ = NULL;
   }

// Parses the source code represented by the compilation info and sets its
=======================================
--- /branches/experimental/parser/src/preparser.h Mon Dec 2 11:45:18 2013 UTC +++ /branches/experimental/parser/src/preparser.h Mon Dec 2 12:00:16 2013 UTC
@@ -49,10 +49,7 @@
         allow_for_of_(false) { }
// TODO(mstarzinger): Only virtual until message reporting has been unified. // FIXME: Might need to continue to be virtual for the experimental branch.
-  virtual ~ParserBase() {
-    delete scanner_;
-    scanner_ = NULL;
-  }
+  virtual ~ParserBase() { }

   // Getters that indicate whether certain syntactical constructs are
   // allowed to be parsed by this instance of the parser.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to