From: Sergey Andreenko Date: Mon, 24 Apr 2017 16:39:25 +0000 (-0700) Subject: do not use = {nullptr} initialization. (dotnet/coreclr#11153) X-Git-Tag: submit/tizen/20210909.063632~11030^2~7149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=254c79d26875d328b015f1870e1aba3f3b4f1c31;p=platform%2Fupstream%2Fdotnet%2Fruntime.git do not use = {nullptr} initialization. (dotnet/coreclr#11153) It worked incorrectly on desktop. Commit migrated from https://github.com/dotnet/coreclr/commit/5c8b9a6870a58e0af250ff822ca395e3fd8268bb --- diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index c385155..256213e 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/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/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 2e3ca81..432cfc9 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/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/coreclr/src/jit/lsra.cpp b/src/coreclr/src/jit/lsra.cpp index 5576140..0ac1d24 100644 --- a/src/coreclr/src/jit/lsra.cpp +++ b/src/coreclr/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;