<div dir="ltr">Based on git blame, it looks like its been like since the file was created in 2009. Based on that we should probably just keep the one assignment above the switch.<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 16, 2019 at 1:31 PM Smith, Cameron T via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_1445445752053794082WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;color:black">In the file </span><span style="font-size:11pt;font-family:Consolas;color:black">llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp</span><span style="font-size:11pt;color:black"> in
the function </span><span style="font-size:11pt;font-family:Consolas;color:black">readDisplacement</span><span style="font-size:11pt;color:black"> (line 1235),</span><span style="font-size:11pt;font-family:Consolas;color:black">insn->consumedDisplacement</span><span style="font-size:11pt;color:black"> is
set to </span><span style="font-size:11pt;font-family:Consolas;color:black">true</span><span style="font-size:11pt;color:black"> on line 1245. In the proceeding switch statement, the same variable may be set to </span><span style="font-size:11pt;font-family:Consolas;color:black">false</span><span style="font-size:11pt;color:black">,
but the line immediately after the switch (line 1269) always sets it back to </span><span style="font-size:11pt;font-family:Consolas;color:black">true</span><span style="font-size:11pt;color:black">. Here’s a copy of the source:</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;color:black"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">/*</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">* readDisplacement - Consumes the displacement of an instruction.</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">*</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">* @param insn - The instruction whose displacement is to be read.</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">* @return - 0 if the displacement byte was successfully read; nonzero</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">* otherwise.</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(84,84,84)">*/</span></i><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">static</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">int</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(130,170,255)">readDisplacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">struct</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(255,203,107)">InternalInstruction</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">*</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(255,83,112)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">)</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">{</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">int8_t</span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d8</span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span lang="FR" style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">int16_t</span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d16</span><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span lang="FR" style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span lang="FR" style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">int32_t</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d32</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(130,170,255)">dbgprintf</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">,</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">"</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(195,232,141)">readDisplacement()</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">");</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">if</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">consumedDisplacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">)</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">return</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">0</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">consumedDisplacement </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">true</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;
// The value is always set to ‘true’ here</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">displacementOffset </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">readerCursor </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">-</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">startLocation</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">switch</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">eaDisplacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">)</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">{</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">case</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> EA_DISP_NONE</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">:</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">consumedDisplacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">false</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;
// The value may be set to ‘false’ here</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">break</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;
// Control flow skips to the end of the switch</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">case</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> EA_DISP_8</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">:</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">if</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(130,170,255)">consumeInt8</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">,</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">&</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">d8</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">))</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">return</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">-</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">displacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d8</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">break</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">case</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> EA_DISP_16</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">:</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">if</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(130,170,255)">consumeInt16</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">,</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">&</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">d16</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">))</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">return</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">-</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">displacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d16</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">break</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">case</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> EA_DISP_32</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">:</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">if</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(130,170,255)">consumeInt32</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">(</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">,</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">&</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">d32</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">))</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">return</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">-</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(240,113,120)">displacement</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> d32</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">break</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">}</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> insn</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">-></span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)">consumedDisplacement </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(199,146,234)">=</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">true</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;
// The value is always set to ‘true’ again, reversing the change that was</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)"> // made if insn->eaDisplacement == EA_DISP_NONE</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">return</span></i><span style="font-size:10.5pt;font-family:Menlo;color:rgb(238,255,255)"> </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(247,140,108)">0</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">;</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:15.75pt;background:rgb(33,33,33)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(137,221,255)">}</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;color:black"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;color:black">I’m not sure if this is a bug or if it was intentional. If the logic is not correct, what would be the appropriate fix? If it would be more appropriate to file a formal bug report let me know and
I can file one.</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;color:black"> </span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;color:black">~ Cameron Smith</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>