Summary: | Fix exception scope verification failures in JSONObject.cpp. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | fpizlo, ggaren, jfbastien, keith_miller, msaboff, saam, ysuzuki | ||||
Priority: | P2 | ||||||
Version: | WebKit Local Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 162351 | ||||||
Attachments: |
|
Description
Mark Lam
2016-11-21 22:53:42 PST
Created attachment 295328 [details]
proposed patch.
Comment on attachment 295328 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=295328&action=review > Source/JavaScriptCore/runtime/JSONObject.cpp:233 > + if (UNLIKELY(scope.exception())) Why not RETURN_IF_EXCEPTION > Source/JavaScriptCore/runtime/JSONObject.cpp:243 > + if (UNLIKELY(scope.exception())) Ditto > Source/JavaScriptCore/runtime/JSONObject.cpp:278 > + if ((stringifyResult != StringifySucceeded)) Style: Extra parens > Source/JavaScriptCore/runtime/JSONObject.cpp:861 > + auto throwScope = DECLARE_THROW_SCOPE(vm); Could this be a catch scope instead? Comment on attachment 295328 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=295328&action=review >> Source/JavaScriptCore/runtime/JSONObject.cpp:233 >> + if (UNLIKELY(scope.exception())) > > Why not RETURN_IF_EXCEPTION Because this is in a constructor, and constructors do not like "return void()". >> Source/JavaScriptCore/runtime/JSONObject.cpp:243 >> + if (UNLIKELY(scope.exception())) > > Ditto Same. In a constructor. >> Source/JavaScriptCore/runtime/JSONObject.cpp:278 >> + if ((stringifyResult != StringifySucceeded)) > > Style: Extra parens Missing an "UNLIKELY" before the inner (). Will fix. >> Source/JavaScriptCore/runtime/JSONObject.cpp:861 >> + auto throwScope = DECLARE_THROW_SCOPE(vm); > > Could this be a catch scope instead? I'm not sure. But at least one client of JSONStringify() (i.e. JSValueCreateJSONString) is expecting it to be able to throw an exception. I'll leave it with a ThrowScope for now. Thanks for the review. Landed in r208966: <http://trac.webkit.org/r208966>. |