From 5c8b9a6870a58e0af250ff822ca395e3fd8268bb Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Mon, 24 Apr 2017 09:39:25 -0700 Subject: [PATCH] do not use = {nullptr} initialization. (#11153) It worked incorrectly on desktop. --- src/jit/flowgraph.cpp | 7 ++++--- src/jit/importer.cpp | 3 ++- src/jit/lsra.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index c385155..256213e 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -21809,8 +21809,8 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe noway_assert(opts.OptEnabled(CLFLG_INLINING)); // This is the InlineInfo struct representing a method to be inlined. - InlineInfo inlineInfo = {nullptr}; - + InlineInfo inlineInfo; + memset(&inlineInfo, 0, sizeof(inlineInfo)); CORINFO_METHOD_HANDLE fncHandle = call->gtCallMethHnd; inlineInfo.fncHandle = fncHandle; @@ -21850,7 +21850,8 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe CORINFO_METHOD_HANDLE fncHandle; InlineCandidateInfo* inlineCandidateInfo; InlineInfo* inlineInfo; - } param = {nullptr}; + } param; + memset(¶m, 0, sizeof(param)); param.pThis = this; param.call = call; diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 2e3ca81..432cfc9 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -17169,7 +17169,8 @@ void Compiler::impCheckCanInline(GenTreePtr call, CORINFO_CONTEXT_HANDLE exactContextHnd; InlineResult* result; InlineCandidateInfo** ppInlineCandidateInfo; - } param = {nullptr}; + } param; + memset(¶m, 0, sizeof(param)); param.pThis = this; param.call = call; diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp index 5576140..0ac1d24 100644 --- a/src/jit/lsra.cpp +++ b/src/jit/lsra.cpp @@ -9677,10 +9677,12 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock, // What interval is this register associated with? // (associated with incoming reg) - Interval* sourceIntervals[REG_COUNT] = {nullptr}; + Interval* sourceIntervals[REG_COUNT]; + memset(&sourceIntervals, 0, sizeof(sourceIntervals)); // Intervals for vars that need to be loaded from the stack - Interval* stackToRegIntervals[REG_COUNT] = {nullptr}; + Interval* stackToRegIntervals[REG_COUNT]; + memset(&stackToRegIntervals, 0, sizeof(stackToRegIntervals)); // Get the starting insertion point for the "to" resolution GenTreePtr insertionPoint = nullptr; -- 2.7.4