Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 26 additions & 98 deletions docs/coding-guidelines/clr-code-guide.md

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5402,12 +5402,6 @@ void Debugger::TraceCall(const BYTE *code)
// There are situations where our callers can't tolerate us throwing.
EX_TRY
{
// Since we have a try catch and the debugger code can deal properly with
// faults occurring inside DebuggerController::DispatchTraceCall, we can safely
// establish a FAULT_NOT_FATAL region. This is required since some callers can't
// tolerate faults.
FAULT_NOT_FATAL();

DebuggerController::DispatchTraceCall(pCurThread, code);
}
EX_CATCH
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/debug/ee/debuggermessagebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ static int MessageBoxImpl(
{
CONTRACTL
{
INJECT_FAULT(return IDCANCEL;);

// Assert if none of MB_ICON is set
PRECONDITION((uType & MB_ICONMASK) != 0);
}
Expand Down Expand Up @@ -100,7 +98,6 @@ static int UtilMessageBoxNonLocalized(
CONTRACTL
{
NOTHROW;
INJECT_FAULT(return IDCANCEL;);

// Assert if none of MB_ICON is set
PRECONDITION((uType & MB_ICONMASK) != 0);
Expand Down Expand Up @@ -152,7 +149,6 @@ int NotifyUserOfFaultMessageBox(
CONTRACTL
{
NOTHROW;
INJECT_FAULT(return IDCANCEL;);
}
CONTRACTL_END;

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/ee/functioninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,6 @@ void DebuggerMethodInfo::DJIIterator::Next(BOOL fFirst /*=FALSE*/)
{
NOTHROW;
GC_NOTRIGGER;
FORBID_FAULT;
MODE_ANY;
CANNOT_TAKE_LOCK;
}
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/gc/background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,6 @@ void gc_heap::background_grow_c_mark_list()
dprintf (2, ("stack copy buffer overflow"));
uint8_t** new_c_mark_list = 0;
{
FAULT_NOT_FATAL();
if (c_mark_list_length >= (SIZE_T_MAX / (2 * sizeof (uint8_t*))))
{
should_drain_p = TRUE;
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/gc/env/gcenv.base.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,10 @@ inline void* ALIGN_DOWN(void* ptr, size_t alignment)
#define GC_NOTRIGGER
#define CAN_TAKE_LOCK
#define SUPPORTS_DAC
#define FORBID_FAULT
#define CONTRACTL_END
#define TRIGGERSGC()
#define WRAPPER(_contract)
#define DISABLED(_contract)
#define INJECT_FAULT(_expr)
#define INJECTFAULT_GCHEAP 0x2
#define FAULT_NOT_FATAL()
#define BEGIN_DEBUG_ONLY_CODE
#define END_DEBUG_ONLY_CODE
#define BEGIN_GETTHREAD_ALLOWED
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/gc/handletable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ HHANDLETABLE HndCreateHandleTable(const uint32_t *pTypeFlags, uint32_t uTypeCoun
{
NOTHROW;
GC_NOTRIGGER;
INJECT_FAULT(return NULL);
}
CONTRACTL_END;

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/gc/handletablecache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ void TableFullRebalanceCache(HandleTable *pTable,

{
// allocate the new handles - we intentionally don't check for success here
FAULT_NOT_FATAL();

uHandleCount += TableAllocBulkHandles(pTable, uType, pHandleBase, uAlloc);
}
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/gc/handletablescan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,6 @@ PTR_TableSegment CALLBACK StandardSegmentIterator(PTR_HandleTable pTable, PTR_Ta
{
WRAPPER(NOTHROW);
WRAPPER(GC_TRIGGERS);
FORBID_FAULT;
SUPPORTS_DAC;
}
CONTRACTL_END;
Expand Down Expand Up @@ -1479,7 +1478,6 @@ PTR_TableSegment CALLBACK FullSegmentIterator(PTR_HandleTable pTable, PTR_TableS
{
WRAPPER(THROWS);
WRAPPER(GC_TRIGGERS);
FORBID_FAULT;
SUPPORTS_DAC;
}
CONTRACTL_END;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/gc/objecthandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ bool Ref_Initialize()
{
NOTHROW;
WRAPPER(GC_NOTRIGGER);
INJECT_FAULT(return false);
}
CONTRACTL_END;

Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/inc/caparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ class CustomAttributeParser {
HRESULT GetString(LPCUTF8 *pszString, ULONG *pcbString)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_FORBID_FAULT;

HRESULT hr;

Expand Down Expand Up @@ -309,7 +308,6 @@ class CustomAttributeParser {
HRESULT GetNonNullString(LPCUTF8 *pszString, ULONG *pcbString)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_FORBID_FAULT;

HRESULT hr;

Expand All @@ -330,7 +328,6 @@ class CustomAttributeParser {
HRESULT GetNonEmptyString(LPCUTF8 *pszString, ULONG *pcbString)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_FORBID_FAULT;

HRESULT hr;

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/ceegentokenmapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ friend class PESectionMan;
virtual ULONG STDMETHODCALLTYPE Release()
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_FORBID_FAULT;
SUPPORTS_DAC_HOST_ONLY;

ULONG cRefs = --m_cRefs;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ CONFIG_DWORD_INFO(INTERNAL_ConditionalContracts, W("ConditionalContracts"), 0, "
CONFIG_DWORD_INFO(INTERNAL_ConsistencyCheck, W("ConsistencyCheck"), 0, "")
CONFIG_DWORD_INFO(INTERNAL_ContinueOnAssert, W("ContinueOnAssert"), 0, "If set, doesn't break on asserts.")
CONFIG_DWORD_INFO(INTERNAL_InjectFatalError, W("InjectFatalError"), 0, "")
CONFIG_DWORD_INFO(INTERNAL_InjectFault, W("InjectFault"), 0, "")
CONFIG_DWORD_INFO(INTERNAL_SuppressChecks, W("SuppressChecks"),0, "")
CONFIG_DWORD_INFO(INTERNAL_SuppressLockViolationsOnReentryFromOS, W("SuppressLockViolationsOnReentryFromOS"), 0, "64 bit OOM tests re-enter the CLR via RtlVirtualUnwind. This indicates whether to suppress resulting locking violations.")

Expand Down
Loading
Loading