NEW 172256
It should be a runtime error to call ExceptionOr::releaseReturnValue() more than once
https://bugs.webkit.org/show_bug.cgi?id=172256
Summary It should be a runtime error to call ExceptionOr::releaseReturnValue() more t...
Andy Estes
Reported 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.
Attachments
Darin Adler
Comment 1 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.
Note You need to log in before you can comment on or make changes to this bug.