Author: [email protected]
Date: Thu Dec 18 01:39:18 2008
New Revision: 995

Modified:
    branches/bleeding_edge/src/ic.cc

Log:
Fix an issue of a raw pointer being returned after possible allocation.
Review URL: http://codereview.chromium.org/14833

Modified: branches/bleeding_edge/src/ic.cc
==============================================================================
--- branches/bleeding_edge/src/ic.cc    (original)
+++ branches/bleeding_edge/src/ic.cc    Thu Dec 18 01:39:18 2008
@@ -355,14 +355,19 @@
      // If performing debug step into then flood this function with one-shot
      // break points if it is called from where step into was requested.
      if (Debug::StepInActive() && fp() == Debug::step_in_fp()) {
+      // Protect the result in a handle as the debugger can allocate and  
might
+      // cause GC.
+      HandleScope scope;
+      Handle<Object> result_handle(result);
        // Don't allow step into functions in the native context.
        if (JSFunction::cast(result)->context()->global() !=
            Top::context()->builtins()) {
-        HandleScope scope;
          Handle<SharedFunctionInfo>  
shared(JSFunction::cast(result)->shared());
          Debug::FloodWithOneShot(shared);
        }
+      return *result_handle;
      }
+
      return result;
    }


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

Reply via email to