Commit 89cd0677 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Add check to external string resource.

Extensions are a source of external strings where we don't perform check yet.

R=ulan@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/10878025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5b2282c6
...@@ -2539,7 +2539,7 @@ class V8EXPORT Extension { // NOLINT ...@@ -2539,7 +2539,7 @@ class V8EXPORT Extension { // NOLINT
// Note that the strings passed into this constructor must live as long // Note that the strings passed into this constructor must live as long
// as the Extension itself. // as the Extension itself.
Extension(const char* name, Extension(const char* name,
const char* source = 0, const char* source,
int dep_count = 0, int dep_count = 0,
const char** deps = 0, const char** deps = 0,
int source_length = -1); int source_length = -1);
......
...@@ -537,11 +537,13 @@ Extension::Extension(const char* name, ...@@ -537,11 +537,13 @@ Extension::Extension(const char* name,
: name_(name), : name_(name),
source_length_(source_length >= 0 ? source_length_(source_length >= 0 ?
source_length : source_length :
(source ? static_cast<int>(strlen(source)) : 0)), static_cast<int>(strlen(source))),
source_(source, source_length_), source_(source, source_length_),
dep_count_(dep_count), dep_count_(dep_count),
deps_(deps), deps_(deps),
auto_enable_(false) { } auto_enable_(false) {
CHECK(source);
}
v8::Handle<Primitive> Undefined() { v8::Handle<Primitive> Undefined() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment