We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec17b1f commit ee4e249Copy full SHA for ee4e249
src/CLR/Core/Checks.cpp
@@ -9,11 +9,21 @@
9
10
HRESULT CLR_Checks::VerifyStackOK(const CLR_RT_StackFrame &stack, const CLR_RT_HeapBlock *top, const int num)
11
{
12
- (void)stack;
13
- (void)top;
14
- (void)num;
+ NANOCLR_HEADER();
+
+ // Check if stack has enough space for num elements
15
+ if (top + num > stack.m_evalStackEnd)
16
+ {
17
+ NANOCLR_SET_AND_LEAVE(CLR_E_STACK_OVERFLOW);
18
+ }
19
- return S_OK;
20
+ // Check if top is within stack bounds
21
+ if (top < stack.m_evalStack || top >= stack.m_evalStackEnd)
22
23
+ NANOCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
24
25
26
+ NANOCLR_NOCLEANUP();
27
}
28
29
HRESULT CLR_Checks::VerifyObject(CLR_RT_HeapBlock &top)
0 commit comments