Reviewers: ulan,

Message:
Committed patchset #1 manually as r18186 (presubmit successful).

Description:
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=

Committed: https://code.google.com/p/v8/source/detail?r=18186

Please review this at https://codereview.chromium.org/98933002/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+3, -4 lines):
  M src/parser.h
  M src/preparser.h


Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index e5024b931b2d5782fcdf1123e241a6b9a38f7f09..cdfcd92d25cfb52994ca5112d61fdc460db211ba 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -414,6 +414,8 @@ class Parser : public ParserBase {
   ~Parser() {
     delete reusable_preparser_;
     reusable_preparser_ = NULL;
+    delete scanner_;
+    scanner_ = NULL;
   }

// Parses the source code represented by the compilation info and sets its
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 3cbd0dd9e557d5bb1c670bd0444863abcd1853dd..ad57384549551aef0075df7a6fb66a3358de789d 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -49,10 +49,7 @@ class ParserBase {
         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