Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/api.cc

Issue 1235002: Allow empty handles to escape handle scopes. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index d8e85b9acd17daa822510870ddb8a9e7bdd298b4..2100480e85864356f1f6c04cfaee13736eede544 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -537,10 +537,17 @@ i::Object** v8::HandleScope::RawClose(i::Object** value) {
LOG_API("CloseHandleScope");
// Read the result before popping the handle block.
- i::Object* result = *value;
+ i::Object* result = NULL;
+ if (value != NULL) {
+ result = *value;
+ }
is_closed_ = true;
i::HandleScope::Leave(&previous_);
+ if (value == NULL) {
+ return NULL;
+ }
+
// Allocate a new handle on the previous handle block.
i::Handle<i::Object> handle(result);
return handle.location();
« no previous file with comments | « src/api.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698