Revision: 12475
Author:   [email protected]
Date:     Mon Sep 10 09:32:59 2012
Log:      Merged r12308 into 3.12 branch.

Do checks when receiving external string resources through the API.

BUG=140050

[email protected]

Review URL: https://chromiumcodereview.appspot.com/10928085
http://code.google.com/p/v8/source/detail?r=12475

Modified:
 /branches/3.12/src/api.cc
 /branches/3.12/src/version.cc

=======================================
--- /branches/3.12/src/api.cc   Wed Sep  5 13:04:15 2012
+++ /branches/3.12/src/api.cc   Mon Sep 10 09:32:59 2012
@@ -4789,6 +4789,7 @@
   EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()");
   LOG_API(isolate, "String::NewExternal");
   ENTER_V8(isolate);
+  CHECK(resource && resource->data());
   i::Handle<i::String> result = NewExternalStringHandle(isolate, resource);
   isolate->heap()->external_string_table()->AddString(*result);
   return Utils::ToLocal(result);
@@ -4809,6 +4810,7 @@
   if (isolate->heap()->IsInGCPostProcessing()) {
     return false;
   }
+  CHECK(resource && resource->data());
   bool result = obj->MakeExternal(resource);
   if (result && !obj->IsSymbol()) {
     isolate->heap()->external_string_table()->AddString(*obj);
@@ -4823,6 +4825,7 @@
   EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()");
   LOG_API(isolate, "String::NewExternal");
   ENTER_V8(isolate);
+  CHECK(resource && resource->data());
i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource);
   isolate->heap()->external_string_table()->AddString(*result);
   return Utils::ToLocal(result);
@@ -4844,6 +4847,7 @@
   if (isolate->heap()->IsInGCPostProcessing()) {
     return false;
   }
+  CHECK(resource && resource->data());
   bool result = obj->MakeExternal(resource);
   if (result && !obj->IsSymbol()) {
     isolate->heap()->external_string_table()->AddString(*obj);
=======================================
--- /branches/3.12/src/version.cc       Thu Sep  6 01:05:05 2012
+++ /branches/3.12/src/version.cc       Mon Sep 10 09:32:59 2012
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     12
 #define BUILD_NUMBER      19
-#define PATCH_LEVEL       7
+#define PATCH_LEVEL       8
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to