Skip to content

Commit 4401e3f

Browse files
committed
MSFT:15871527 Add macros to convert OOM to HRESULT on OnDebuggerDetached.
1 parent 21bf50f commit 4401e3f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/Runtime/Base/ScriptContext.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,8 +3716,20 @@ namespace Js
37163716
// Debugger attach/detach failure is catastrophic, take down the process
37173717
DEBUGGER_ATTACHDETACH_FATAL_ERROR_IF_FAILED(hr);
37183718

3719-
// Still do the pass on the function's entrypoint to reflect its state with the functionbody's entrypoint.
3720-
this->UpdateRecyclerFunctionEntryPointsForDebugger();
3719+
HRESULT hrEntryPointUpdate = S_OK;
3720+
BEGIN_TRANSLATE_OOM_TO_HRESULT_NESTED
3721+
{
3722+
// Still do the pass on the function's entrypoint to reflect its state with the functionbody's entrypoint.
3723+
this->UpdateRecyclerFunctionEntryPointsForDebugger();
3724+
}
3725+
END_TRANSLATE_OOM_TO_HRESULT(hrEntryPointUpdate);
3726+
3727+
if (hrEntryPointUpdate != S_OK)
3728+
{
3729+
// should only be here for OOM
3730+
Assert(hrEntryPointUpdate == E_OUTOFMEMORY);
3731+
return hrEntryPointUpdate;
3732+
}
37213733

37223734
OUTPUT_TRACE(Js::DebuggerPhase, _u("ScriptContext::OnDebuggerDetached: done 0x%p, hr = 0x%X\n"), this, hr);
37233735

0 commit comments

Comments
 (0)