<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>255839</bug_id>
          
          <creation_ts>2023-04-23 00:03:30 -0700</creation_ts>
          <short_desc>For-In Iterator uses wrong length.</short_desc>
          <delta_ts>2023-04-23 14:26:29 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="EntryHi">entryhii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1950619</commentid>
    <comment_count>0</comment_count>
    <who name="EntryHi">entryhii</who>
    <bug_when>2023-04-23 00:03:30 -0700</bug_when>
    <thetext>======================test.js========================
const v0 = [1,2,3];
for (const v1 in v0) {
  print(1)
  for (let v8 = 0; v8 &lt; 20; v8++) {}
  Object.seal(v0);
  class C19 {}
}
=====================================================
With the above script as input to JSC, run JSC with the following parameters:
./jsc test.js --useConcurrentJIT=0  --jitPolicyScale=0  
./jsc test.js --useConcurrentJIT=0  --jitPolicyScale=0.001 

The corrent result should print three &quot;1&quot;. However, JSC print less than three &quot;1&quot; when jitPolicyScale is 0.
The problem may be iterator use wrong length in DFG.

Here is another example that triggers the same bug.

====================Another test.js==================
const v0 = [-2709013226, -741588015, -65535, 128, 2667997042, 65537];
for (let v3 in v0) {
  print(1)
  for (let v24 = 0; v24 &lt; 10; v24++) {
    Object.defineProperty(v0, v24, {value: v24});
    class v12 {}
  }
}
======================================================
The parameters are the same as above.
The correct result should print six &quot;1&quot;. However , JSC print four &quot;1&quot; when jitPolicyScale is 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950663</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-04-23 14:26:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/108430176&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>