From f7c85755ba3b7751374a3dcfb17132ffa2f1db65 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Wed, 7 Jul 2010 10:28:22 +0000 Subject: [PATCH] Prevent invalid pre-parsing data passed in through the API from crashing V8. Review URL: http://codereview.chromium.org/2876046 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5030 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/messages.js | 3 ++- src/parser.cc | 17 +++++++++++++++++ test/cctest/test-api.cc | 37 +++++++++++++++++++++++++++++++++++++ test/mjsunit/fuzz-natives.js | 2 +- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/messages.js b/src/messages.js index 7bac3b2..99ba454 100644 --- a/src/messages.js +++ b/src/messages.js @@ -197,7 +197,8 @@ function FormatMessage(message) { obj_ctor_property_non_object: "Object.%0 called on non-object", array_indexof_not_defined: "Array.getIndexOf: Argument undefined", object_not_extensible: "Can't add property %0, object is not extensible", - illegal_access: "illegal access" + illegal_access: "Illegal access", + invalid_preparser_data: "Invalid preparser data for function %0" }; } var format = kMessages[message.type]; diff --git a/src/parser.cc b/src/parser.cc index 31bac91..fb58cfa 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -134,6 +134,7 @@ class Parser { // Report syntax error void ReportUnexpectedToken(Token::Value token); + void ReportInvalidPreparseData(Handle name, bool* ok); Handle