Add defensive assert against a weak callback on an empty persistent.
authorvogelheim@chromium.org <vogelheim@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 27 May 2014 12:26:44 +0000 (12:26 +0000)
committervogelheim@chromium.org <vogelheim@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 27 May 2014 12:26:44 +0000 (12:26 +0000)
(This shouldn't happen in the first place, as by definition that callback would never be called. However, the referenced bug sorta looks like this happened. If so, the CHECK should help us pinpoint the culprit.)

R=jochen@chromium.org
BUG=368095
LOG=N

Review URL: https://codereview.chromium.org/265823006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/global-handles.cc

index d6cd479..82b5f3d 100644 (file)
@@ -207,6 +207,7 @@ class GlobalHandles::Node {
   void MakeWeak(void* parameter, WeakCallback weak_callback) {
     ASSERT(weak_callback != NULL);
     ASSERT(state() != FREE);
+    CHECK(object_ != NULL);
     set_state(WEAK);
     set_parameter(parameter);
     weak_callback_ = weak_callback;