| Summary: | [WTF] Avoid JSONValue::create with raw string falling to bool overload | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Lauro Moura <lmoura> | ||||
| Component: | New Bugs | Assignee: | Lauro Moura <lmoura> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | aperez, bburg, benjamin, bugs-noreply, cdumez, cmarcelo, ews-watchlist, hi, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=218686 | ||||||
| Attachments: |
|
||||||
|
Description
Lauro Moura
2020-12-02 22:03:40 PST
Created attachment 415278 [details]
Patch
Comment on attachment 415278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=415278&action=review > Source/WTF/wtf/JSONValues.h:81 > + static Ref<Value> create(T) = delete; If `create(T)` is too strict, it could use `create(T*)` instead, to avoid only the pointer conversions. Comment on attachment 415278 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=415278&action=review >> Source/WTF/wtf/JSONValues.h:81 >> + static Ref<Value> create(T) = delete; > > If `create(T)` is too strict, it could use `create(T*)` instead, to avoid only the pointer conversions. I think this is fine, and forbidding all possible implicit conversions is probably even a good thing, thus ensuring that only the provided create() factory functions are ever used. Committed r270391: <https://trac.webkit.org/changeset/270391> All reviewed patches have been landed. Closing bug and clearing flags on attachment 415278 [details]. |