Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0303386

Browse files
sdmacleahoyosjs
authored andcommitted
Abort FuncEval on unaligned SP (for 3.1) (#26607)
* Abort FuncEval on unaligned SP (#26572) * Check for nullity of the context in FuncEval setup SP alignment checks (#26911)
1 parent d289ccc commit 0303386

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/debug/ee/debugger.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15306,6 +15306,13 @@ HRESULT Debugger::FuncEvalSetup(DebuggerIPCE_FuncEvalInfo *pEvalInfo,
1530615306
return CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT;
1530715307
}
1530815308

15309+
if (filterContext != NULL && ::GetSP(filterContext) != ALIGN_DOWN(::GetSP(filterContext), STACK_ALIGN_SIZE))
15310+
{
15311+
// SP is not aligned, we cannot do a FuncEval here
15312+
LOG((LF_CORDB, LL_INFO1000, "D::FES SP is unaligned"));
15313+
return CORDBG_E_FUNC_EVAL_BAD_START_POINT;
15314+
}
15315+
1530915316
// Create a DebuggerEval to hold info about this eval while its in progress. Constructor copies the thread's
1531015317
// CONTEXT.
1531115318
DebuggerEval *pDE = new (interopsafe, nothrow) DebuggerEval(filterContext, pEvalInfo, fInException);
@@ -15439,6 +15446,13 @@ HRESULT Debugger::FuncEvalSetupReAbort(Thread *pThread, Thread::ThreadAbortReque
1543915446
return CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT;
1544015447
}
1544115448

15449+
if (::GetSP(filterContext) != ALIGN_DOWN(::GetSP(filterContext), STACK_ALIGN_SIZE))
15450+
{
15451+
// SP is not aligned, we cannot do a FuncEval here
15452+
LOG((LF_CORDB, LL_INFO1000, "D::FESRA: SP is unaligned"));
15453+
return CORDBG_E_FUNC_EVAL_BAD_START_POINT;
15454+
}
15455+
1544215456
// Create a DebuggerEval to hold info about this eval while its in progress. Constructor copies the thread's
1544315457
// CONTEXT.
1544415458
DebuggerEval *pDE = new (interopsafe, nothrow) DebuggerEval(filterContext, pThread, requester);

0 commit comments

Comments
 (0)