Bug 78194 - ASSERT_NO_EXCEPTION should be initialized with non-zero value.
Summary: ASSERT_NO_EXCEPTION should be initialized with non-zero value.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 18:55 PST by Shinya Kawanaka
Modified: 2012-02-09 03:22 PST (History)
3 users (show)

See Also:


Attachments
W.I.P. (2.28 KB, patch)
2012-02-08 19:42 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
W.I.P. (2.51 KB, patch)
2012-02-08 20:02 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (2.58 KB, patch)
2012-02-08 20:20 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (2.57 KB, patch)
2012-02-08 21:32 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.