<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Undefined Behavior in JSValue cast from NaN"
   href="https://bugs.webkit.org/show_bug.cgi?id=160322#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Undefined Behavior in JSValue cast from NaN"
   href="https://bugs.webkit.org/show_bug.cgi?id=160322">bug 160322</a>
              from <span class="vcard"><a class="email" href="mailto:mark.lam&#64;apple.com" title="Mark Lam &lt;mark.lam&#64;apple.com&gt;"> <span class="fn">Mark Lam</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=160322#c2">comment #2</a>)
<span class="quote">&gt; Do we still have an undefined behavior when the passed value just happens to
&gt; be a NaN?
&gt; 
&gt; The compiler will not see it and thus won't do anything bad, presumably.</span >

jsNaN() calls JSValue(double), and JSValue(double) casts the double value to an int32_t, which is undefined according to <a href="http://stackoverflow.com/questions/3986795/what-is-the-result-of-casting-float-inf-inf-and-nan-to-integer-in-c">http://stackoverflow.com/questions/3986795/what-is-the-result-of-casting-float-inf-inf-and-nan-to-integer-in-c</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>