WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
65598
[V8] V8CSSRuleCustom.cpp: not all enum values are listed in switch statement
https://bugs.webkit.org/show_bug.cgi?id=65598
Summary
[V8] V8CSSRuleCustom.cpp: not all enum values are listed in switch statement
Roland Steiner
Reported
2011-08-03 00:42:09 PDT
The (only) switch statement in V8CSSRuleCustom.cpp misses an entry for UNKNOWN_RULE. Although it's fine that UNKNOWN_RULE is handled by the fallback code, this causes a build warning -> error when the type() function used in the switch() expression is changed to return an enum (currently unsigned int). This blocks
https://bugs.webkit.org/show_bug.cgi?id=65506
.
Attachments
Patch
(1.63 KB, patch)
2011-08-03 00:45 PDT
,
Roland Steiner
no flags
Details
Formatted Diff
Diff
Patch
(1.63 KB, patch)
2011-08-03 02:24 PDT
,
Roland Steiner
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Roland Steiner
Comment 1
2011-08-03 00:45:47 PDT
Created
attachment 102748
[details]
Patch
Dominic Cooney
Comment 2
2011-08-03 02:06:12 PDT
Comment on
attachment 102748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=102748&action=review
> Source/WebCore/ChangeLog:6 > + Added UNKNOWN_RULE to the switch() statement.
Drop the parens?
> Source/WebCore/ChangeLog:8 > + Reviewed by NOBODY (OOPS!).
Doesn’t this go before the previous paragraph.
> Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp:49 > switch (impl->type()) {
If the switch is exhausted, isn’t the code after the switch dead? You should remove it.
> Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp:51 > + // CSSUnknownRule.idl is explicitly excluded as it doesn't add anything
Shorten this? You don’t need to talk about GYP files or IDL files… just say you’re wrapping at the base type.
Roland Steiner
Comment 3
2011-08-03 02:24:48 PDT
Created
attachment 102756
[details]
Patch
Roland Steiner
Comment 4
2011-08-03 02:27:37 PDT
(In reply to
comment #2
)
> (From update of
attachment 102748
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=102748&action=review
> > > Source/WebCore/ChangeLog:6 > > + Added UNKNOWN_RULE to the switch() statement. > > Drop the parens?
Sure.
> > Source/WebCore/ChangeLog:8 > > + Reviewed by NOBODY (OOPS!). > > Doesn’t this go before the previous paragraph.
Oops, that's right - corrected.
> > Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp:49 > > switch (impl->type()) { > > If the switch is exhausted, isn’t the code after the switch dead? You should remove it.
type() still returns unsigned int, so the compiler would scream at me. Can only remove with the patch to
bug 65506
.
> > Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp:51 > > + // CSSUnknownRule.idl is explicitly excluded as it doesn't add anything > > Shorten this? You don’t need to talk about GYP files or IDL files… just say you’re wrapping at the base type.
Originally I had return toV8(static_cast<CSSUnknownRule*>(impl)); but this doesn't link, even though V8CSSUnknownRule.cpp exists. It took me quite a while to figure out why, so I believe this comment has merit.
WebKit Review Bot
Comment 5
2011-08-03 09:15:35 PDT
Comment on
attachment 102756
[details]
Patch Clearing flags on attachment: 102756 Committed
r92285
: <
http://trac.webkit.org/changeset/92285
>
WebKit Review Bot
Comment 6
2011-08-03 09:15:40 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug