do not use = {nullptr} initialization. (#11153)
authorSergey Andreenko <seandree@microsoft.com>
Mon, 24 Apr 2017 16:39:25 +0000 (09:39 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Apr 2017 16:39:25 +0000 (09:39 -0700)
It worked incorrectly on desktop.

src/jit/flowgraph.cpp
src/jit/importer.cpp
src/jit/lsra.cpp

index c385155..256213e 100644 (file)
@@ -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(&param, 0, sizeof(param));
 
     param.pThis               = this;
     param.call                = call;
index 2e3ca81..432cfc9 100644 (file)
@@ -17169,7 +17169,8 @@ void Compiler::impCheckCanInline(GenTreePtr             call,
         CORINFO_CONTEXT_HANDLE exactContextHnd;
         InlineResult*          result;
         InlineCandidateInfo**  ppInlineCandidateInfo;
-    } param = {nullptr};
+    } param;
+    memset(&param, 0, sizeof(param));
 
     param.pThis                 = this;
     param.call                  = call;
index 5576140..0ac1d24 100644 (file)
@@ -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;