Bug 172256 - It should be a runtime error to call ExceptionOr::releaseReturnValue() more than once
Summary: It should be a runtime error to call ExceptionOr::releaseReturnValue() more t...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-17 17:14 PDT by Andy Estes
Modified: 2017-05-18 09:36 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2017-05-17 17:14:44 PDT
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't been called more than once.
Comment 1 Darin Adler 2017-05-18 09:36:30 PDT
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.