Bug 172256
| Summary: | It should be a runtime error to call ExceptionOr::releaseReturnValue() more than once | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Andy Estes <aestes> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | cdumez, darin, mitz, sam |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=172253 | ||
Andy Estes
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Darin Adler
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.