Skip to content

Commit

Permalink
Enable new exception handling by default (#98570)
Browse files Browse the repository at this point in the history
* Enable new exception handling by default

This change just flips the config knob to enable the new exception
handling by default.

* Add runtime.config setting for enabling the new EH

* Reflect PR - switch the config name

From the EnableNewExceptionHandling to LegacyExceptionHandling
  • Loading branch information
janvorli authored Feb 23, 2024
1 parent bdab216 commit b80048e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("le
CONFIG_DWORD_INFO(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableNewExceptionHandling, W("EnableNewExceptionHandling"), 0, "Enable new exception handling.");
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_LegacyExceptionHandling, W("LegacyExceptionHandling"), 0, "Enable legacy exception handling.");


///
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "corinfo.h"
#include "exceptionhandlingqcalls.h"
#include "exinfo.h"
#include "configuration.h"

#if defined(TARGET_X86)
#define USE_CURRENT_CONTEXT_IN_FILTER
Expand Down Expand Up @@ -236,7 +237,7 @@ void InitializeExceptionHandling()
// Initialize the lock used for synchronizing access to the stacktrace in the exception object
g_StackTraceArrayLock.Init(LOCK_TYPE_DEFAULT, TRUE);

g_isNewExceptionHandlingEnabled = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableNewExceptionHandling) != 0;
g_isNewExceptionHandlingEnabled = Configuration::GetKnobBooleanValue(W("System.Runtime.LegacyExceptionHandling"), CLRConfig::EXTERNAL_LegacyExceptionHandling ) == 0;

#ifdef TARGET_UNIX
// Register handler of hardware exceptions like null reference in PAL
Expand Down

0 comments on commit b80048e

Please sign in to comment.