<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Win] Fix the wrong return value checking of ScriptItemize in UniscribeController::itemizeShapeAndPlace"
   href="https://bugs.webkit.org/show_bug.cgi?id=192805">192805</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Win] Fix the wrong return value checking of ScriptItemize in UniscribeController::itemizeShapeAndPlace
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Platform
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Hironori.Fujii@sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>[Win] Fix the wrong return value checking of ScriptItemize in UniscribeController::itemizeShapeAndPlace

UniscribeController::itemizeShapeAndPlace has the following code.

<span class="quote">>    while (rc = ::ScriptItemize(cp, length, m_items.size() - 1, &m_control, &m_state, m_items.data(), &numItems) == E_OUTOFMEMORY) {
>        m_items.resize(m_items.size() * 2);
>        resetControlAndState();
>    }
>    if (FAILED(rc)) {
>        WTFLogAlways("UniscribeController::itemizeShapeAndPlace: ScriptItemize failed, rc=%lx", rc);
>        return;
>    }</span >
>

rc is aligned 0 or 1, and checked by FAILED(rc).
'==' has higher operator precedence than  '='.
It is interpreted as:

<span class="quote">> rc = (::ScriptItemize(...) == E_OUTOFMEMORY)</span >

<a href="https://en.cppreference.com/w/cpp/language/operator_precedence">https://en.cppreference.com/w/cpp/language/operator_precedence</a>

This code has been introduced in <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [Win] Resolve various static analyzer warnings in WebCore"
   href="show_bug.cgi?id=137526">Bug 137526</a>.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>