* src/debug/daccess/nidump.cpp: remove dead code
found by cppcheck
[src/debug/daccess/nidump.cpp:2839] -> [src/debug/daccess/nidump.cpp:2841]: (warning) Opposite inner 'if' condition leads to a dead code block.
* src/dlls/dbgshim/dbgshim.cpp: resolve possible null pointer dereference
found by cppcheck
[src/dlls/dbgshim/dbgshim.cpp:1373] -> [src/dlls/dbgshim/dbgshim.cpp:1367]: (warning) Either the condition 'pHandleArray==NULL' is redundant or there is pointer arithmetic with NULL pointer.
* src/ilasm/assembler.cpp: resolve possible null pointer dereference
found by cppcheck
[src/ilasm/assembler.cpp:2331] -> [src/ilasm/assembler.cpp:2330]: (warning) Either the condition 'pMID==NULL' is redundant or there is possible null pointer dereference: pMID.
* src/jit/flowgraph.cpp: resolve possible null pointer dereference
found by cppcheck
[src/jit/flowgraph.cpp:11009] -> [src/jit/flowgraph.cpp:11005]: (warning) Either the condition 'block!=nullptr' is redundant or there is possible null pointer dereference: block.
* src/pal/src/debug/debug.cpp: resolve possible null pointer dereference
found by cppcheck
[src/pal/src/debug/debug.cpp:376] -> [src/pal/src/debug/debug.cpp:381]: (warning) Either the condition 'command_string' is redundant or there is possible null pointer dereference: command_string.
* src/pal/src/libunwind/src/arm/Gex_tables.c: resolve possible null pointer dereference
found by cppcheck
[src/pal/src/libunwind/src/arm/Gex_tables.c:159] -> [src/pal/src/libunwind/src/arm/Gex_tables.c:155]: (warning) Either the condition 'buf!=NULL' is redundant or there is pointer arithmetic with NULL pointer.
* src/pal/src/synchmgr/synchmanager.cpp: resolve possible null pointer dereference
found by cppcheck
[src/pal/src/synchmgr/synchmanager.cpp:2512] -> [src/pal/src/synchmgr/synchmanager.cpp:2510]: (warning) Either the condition 'NULL!=pWLNode' is redundant or there is possible null pointer dereference: pWLNode.
Commit migrated from https://github.com/dotnet/coreclr/commit/
181523f28adf51de198e1772a35c54ec4819e6c9
{
if (sizes[i] != 0 && lowerBounds[i] != 0)
{
- if (lowerBounds[i] == 0)
- buf.AppendPrintf( W("%s"), sizes[i] );
- else
- {
- buf.AppendPrintf( W("%d ..."), lowerBounds[i] );
- if (sizes[i] != 0)
- buf.AppendPrintf( W("%d"),
- lowerBounds[i] + sizes[i]
- + 1 );
- }
+ buf.AppendPrintf( W("%d ..."), lowerBounds[i] );
+ if (sizes[i] != 0)
+ buf.AppendPrintf( W("%d"),
+ lowerBounds[i] + sizes[i]
+ + 1 );
}
if (i < rank-1)
buf.Append( W(",") );
{
PUBLIC_CONTRACT;
- if ((pHandleArray + dwArrayLength) != (HANDLE*)pStringArray)
- return E_INVALIDARG;
-
// It's possible that EnumerateCLRs found nothing to enumerate, in which case
// pointers and count are zeroed. If a debugger calls this function in that
// case, let's not try to delete [] on NULL.
if (pHandleArray == NULL)
return S_OK;
+ if ((pHandleArray + dwArrayLength) != (HANDLE*)pStringArray)
+ return E_INVALIDARG;
+
#ifndef FEATURE_PAL
for (DWORD i = 0; i < dwArrayLength; i++)
{
if(m_pCurClass)
{
MethodImplDescriptor* pMID = new MethodImplDescriptor;
- pMID->m_fNew = TRUE;
if(pMID == NULL)
{
report->error("Failed to allocate MethodImpl Descriptor\n");
return;
}
+ pMID->m_fNew = TRUE;
pMID->m_tkDefiningClass = m_pCurClass->m_cl;
if(szImplementingName) //called from class scope, overriding method specified
{
void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable)
{
- BasicBlock* bPrev = block->bbPrev;
-
/* The block has to be either unreachable or empty */
PREFIX_ASSUME(block != nullptr);
+ BasicBlock* bPrev = block->bbPrev;
+
JITDUMP("fgRemoveBlock " FMT_BB "\n", block->bbNum);
// If we've cached any mappings from switch blocks to SwitchDesc's (which contain only the
FAILED:
if (command_string)
{
+ fprintf (stderr, "Failed to execute command: '%s'\n", command_string);
free(command_string);
}
- fprintf (stderr, "Failed to execute command: '%s'\n", command_string);
return -1;
#else // ENABLE_RUN_ON_DEBUG_BREAK
return 0;
arm_exidx_decode (const uint8_t *buf, uint8_t len, struct dwarf_cursor *c)
{
#define READ_OP() *buf++
+ assert(buf != NULL);
+ assert(len > 0);
const uint8_t *end = buf + len;
int ret;
struct arm_exbuf_data edata;
- assert(buf != NULL);
- assert(len > 0);
-
while (buf < end)
{
uint8_t op = READ_OP ();
BYTE * pbySrc, * pbyDst = rgSendBuf;
WaitingThreadsListNode * pWLNode = SharedIDToTypePointer(WaitingThreadsListNode, shridWLNode);
+
+ _ASSERT_MSG(NULL != pWLNode, "Bad shared wait list node identifier (%p)\n", (VOID*)shridWLNode);
_ASSERT_MSG(gPID != pWLNode->dwProcessId, "WakeUpRemoteThread called on local thread\n");
_ASSERT_MSG(NULL != shridWLNode, "NULL shared identifier\n");
- _ASSERT_MSG(NULL != pWLNode, "Bad shared wait list node identifier (%p)\n", (VOID*)shridWLNode);
_ASSERT_MSG(MsgSize <= PIPE_BUF, "Message too long [MsgSize=%d PIPE_BUF=%d]\n", MsgSize, (int)PIPE_BUF);
TRACE("Waking up remote thread {pid=%x, tid=%x} by sending cmd=%u and shridWLNode=%p over process pipe\n",