Commit e08b33ea authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix memory leak caused by fuzzing.

%DebugPromiseHandlePrologue expects to be followed up by %..Epilogue,
otherwise we get a leak.

R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21489 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2b7810c0
......@@ -813,6 +813,9 @@ void Debug::Unload() {
// Clear the script cache.
DestroyScriptCache();
// Match unmatched PromiseHandlePrologue calls.
while (thread_local_.promise_on_stack_) PromiseHandleEpilogue();
// Clear debugger context global handle.
GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location());
debug_context_ = Handle<Context>();
......@@ -3260,9 +3263,6 @@ EnterDebugger::EnterDebugger(Isolate* isolate)
EnterDebugger::~EnterDebugger() {
Debug* debug = isolate_->debug();
// Leaving this debugger entry.
debug->set_debugger_entry(prev_);
// Restore to the previous break state.
debug->SetBreak(break_frame_id_, break_id_);
......@@ -3283,6 +3283,9 @@ EnterDebugger::~EnterDebugger() {
}
}
// Leaving this debugger entry.
debug->set_debugger_entry(prev_);
isolate_->debugger()->UpdateState();
}
......
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