Bug 78194

Summary: ASSERT_NO_EXCEPTION should be initialized with non-zero value.
Product: WebKit Reporter: Shinya Kawanaka <shinyak>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: morrita, shinyak, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
W.I.P.
none
W.I.P.
none
Patch
none
Patch none

Description Shinya Kawanaka 2012-02-08 18:55:58 PST
We found that ExceptionCode is checked without initializing.

Sometimes ExceptionCode is used without initializing, but it occasionally 'initialized' as 0.
We would like to ensure that "if (ec) {...}" fails if ExceptionCode is not initialized as 0.
Comment 1 Shinya Kawanaka 2012-02-08 19:42:14 PST
Created attachment 126224 [details]
W.I.P.
Comment 2 Shinya Kawanaka 2012-02-08 20:02:14 PST
Created attachment 126229 [details]
W.I.P.
Comment 3 Shinya Kawanaka 2012-02-08 20:20:48 PST
Created attachment 126232 [details]
Patch
Comment 4 Hajime Morrita 2012-02-08 21:19:30 PST
Comment on attachment 126232 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126232&action=review

Thanks for taking this. Our current version is error prone...

> Source/WebCore/dom/ExceptionCodePlaceholder.h:44
> +    ExceptionCodePlaceholder() : m_code(defaultExceptionCode) { }

Please do this for NoExceptionAssertionChecker to keep ExceptionCodePlacerHolder code-free.
Comment 5 Shinya Kawanaka 2012-02-08 21:24:56 PST
(In reply to comment #4)
> (From update of attachment 126232 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126232&action=review
> 
> Thanks for taking this. Our current version is error prone...
> 
> > Source/WebCore/dom/ExceptionCodePlaceholder.h:44
> > +    ExceptionCodePlaceholder() : m_code(defaultExceptionCode) { }
> 
> Please do this for NoExceptionAssertionChecker to keep ExceptionCodePlacerHolder code-free.

Ya, this code seems wrong, because NoExceptionAssertionChecker initializes ExceptionCode with zero.
We should change this value... Let me try again.
Comment 6 Shinya Kawanaka 2012-02-08 21:26:52 PST
I was feeling weird that no error was found by this change...
Comment 7 Shinya Kawanaka 2012-02-08 21:32:16 PST
Created attachment 126235 [details]
Patch
Comment 8 WebKit Review Bot 2012-02-09 03:22:09 PST
Comment on attachment 126235 [details]
Patch

Clearing flags on attachment: 126235

Committed r107208: <http://trac.webkit.org/changeset/107208>
Comment 9 WebKit Review Bot 2012-02-09 03:22:14 PST
All reviewed patches have been landed.  Closing bug.