<?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>275939</bug_id>
          
          <creation_ts>2024-06-26 21:03:44 -0700</creation_ts>
          <short_desc>Negative exponent exception for BigInt not thrown in JIT compiler</short_desc>
          <delta_ts>2024-07-10 18:32:49 -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>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="GuY">q602706150</reporter>
          <assigned_to name="Yijia Huang">yijia_huang</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yijia_huang</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2043348</commentid>
    <comment_count>0</comment_count>
    <who name="GuY">q602706150</who>
    <bug_when>2024-06-26 21:03:44 -0700</bug_when>
    <thetext>The following script should output 10 lines of same result.
```
function opt() {
    try {
        1n ** -1n;
    } catch (e) {
        return e
    }
    return 0;
}
for (let i = 0; i &lt; 10; i++) {
    print(opt())
}
```

Actual output:
```
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
RangeError: Negative exponent is not allowed
0
0
0
```

run args:
cmake-build-debug/bin/jsc --useConcurrentJIT=0 --jitPolicyScale=0.00005 ./test.js

commit id:
47fe298829ac629f561518641b7e6bc4069cb09b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043717</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-06-28 18:03:35 -0700</bug_when>
    <thetext>I can reproduce this on macOS 14.6 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044380</commentid>
    <comment_count>2</comment_count>
    <who name="GuY">q602706150</who>
    <bug_when>2024-07-02 20:24:33 -0700</bug_when>
    <thetext>The same problem happens on div operator.

```
function opt() {
    try {
        0n / 0n
    } catch (e) {
        return e
    }
    return 0;
}
for (let i = 0; i &lt; 10; i++) {
    print(opt())
}
```

Actual output:
```
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
RangeError: 0 is an invalid divisor value.
0
0
0
```

seems that some `Node` that have side effect were removed, because no one was using them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044445</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-07-03 07:47:57 -0700</bug_when>
    <thetext>&lt;rdar://problem/131051084&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2045412</commentid>
    <comment_count>4</comment_count>
    <who name="Yijia Huang">yijia_huang</who>
    <bug_when>2024-07-09 14:41:09 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/30620</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2045623</commentid>
    <comment_count>5</comment_count>
    <who name="Yijia Huang">yijia_huang</who>
    <bug_when>2024-07-10 14:57:11 -0700</bug_when>
    <thetext>*** Bug 276435 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2045675</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-07-10 18:32:47 -0700</bug_when>
    <thetext>Committed 280841@main (02429197cd90): &lt;https://commits.webkit.org/280841@main&gt;

Reviewed commits have been landed. Closing PR #30620 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>