1
- //
1
+ //
2
2
// Copyright (c) .NET Foundation and Contributors
3
3
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
4
4
// See LICENSE file in the project root for full license information.
@@ -193,8 +193,7 @@ HRESULT Library_corlib_native_System_Exception::SetStackTrace(CLR_RT_HeapBlock &
193
193
194
194
#if defined(NANOCLR_TRACE_EXCEPTIONS)
195
195
196
- if (CLR_EE_DBG_IS (NoStackTraceInExceptions) || CLR_EE_DBG_IS_NOT (Enabled) || CLR_EE_IS (Compaction_Pending) ||
197
- g_CLR_RT_ExecutionEngine.m_fPerformGarbageCollection )
196
+ if (CLR_EE_DBG_IS (NoStackTraceInExceptions))
198
197
{
199
198
// stack trace is DISABLED or...
200
199
// no debugger is attached or...
@@ -204,8 +203,11 @@ HRESULT Library_corlib_native_System_Exception::SetStackTrace(CLR_RT_HeapBlock &
204
203
(void )dst;
205
204
(void )array;
206
205
207
- // null the array that would hold the stack trace
208
- obj[FIELD___stackTrace].SetObjectReference (NULL );
206
+ // create an empty array for the stack trace
207
+ NANOCLR_CHECK_HRESULT (CLR_RT_HeapBlock_Array::CreateInstance (
208
+ obj[FIELD___stackTrace],
209
+ depth,
210
+ g_CLR_RT_WellKnownTypes.m_UInt8 ));
209
211
}
210
212
else
211
213
{
@@ -243,10 +245,7 @@ HRESULT Library_corlib_native_System_Exception::SetStackTrace(CLR_RT_HeapBlock &
243
245
if (!g_CLR_RT_ExecutionEngine.m_fShuttingDown )
244
246
#endif
245
247
{
246
- if (CLR_EE_DBG_IS_NOT (NoStackTraceInExceptions) && CLR_EE_DBG_IS (Enabled))
247
- {
248
- CLR_RT_DUMP::EXCEPTION (*stack, ref);
249
- }
248
+ CLR_RT_DUMP::EXCEPTION (*stack, ref);
250
249
}
251
250
}
252
251
0 commit comments