<?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>172256</bug_id>
          
          <creation_ts>2017-05-17 17:14:44 -0700</creation_ts>
          <short_desc>It should be a runtime error to call ExceptionOr::releaseReturnValue() more than once</short_desc>
          <delta_ts>2017-05-18 09:36:30 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=172253</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andy Estes">aestes</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>darin</cc>
    
    <cc>mitz</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1309924</commentid>
    <comment_count>0</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2017-05-17 17:14:44 -0700</bug_when>
    <thetext>Bug #172253 was caused by accidentally calling releaseReturnValue() twice on the same ExceptionOr value. This is a mistake because releaseReturnValue() moves the return value. We should ASSERT that releaseReturnValue() hasn&apos;t been called more than once.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310112</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2017-05-18 09:36:30 -0700</bug_when>
    <thetext>I guess we can do this.

We do this for Ref by asserting the pointer is not null in Ref::leakRef. We don’t do this for RefPtr.

Longer term I think we want to move from ExceptionOr to std::expected. Is that right? If so, we should figure out if std::expected can assert for cases like this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>