Bug 26197 - Incorrect variable initialization in PlatformContextSkia.cpp
Summary: Incorrect variable initialization in PlatformContextSkia.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P3 Trivial
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-04 15:30 PDT by Roland Steiner
Modified: 2009-06-10 11:16 PDT (History)
2 users (show)

See Also:


Attachments
patch correcting the member variable initialization (460 bytes, patch)
2009-06-04 15:31 PDT, Roland Steiner
no flags Details | Formatted Diff | Diff
PlatformContextSkia : fix member initialization (fixed .patch) (553 bytes, patch)
2009-06-04 16:32 PDT, Roland Steiner
eric: review-
Details | Formatted Diff | Diff
ChangeLog entry (784 bytes, patch)
2009-06-04 16:38 PDT, Roland Steiner
no flags Details | Formatted Diff | Diff
patch - remove variable initialization (1.54 KB, patch)
2009-06-04 21:21 PDT, Roland Steiner
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Steiner 2009-06-04 15:30:30 PDT
The PlatformContextSkia constructor does a (very likely) wrong size initialization for its m_stateStack member:

m_stateStack(sizeof(State))

The intended initialization is probably rather

m_stateStack(1)
Comment 1 Roland Steiner 2009-06-04 15:31:28 PDT
Created attachment 30962 [details]
patch correcting the member variable initialization
Comment 2 Roland Steiner 2009-06-04 16:32:07 PDT
Created attachment 30969 [details]
PlatformContextSkia : fix member initialization (fixed .patch)

(fixed .patch format, otherwise same as above)
Comment 3 Roland Steiner 2009-06-04 16:38:23 PDT
Created attachment 30971 [details]
ChangeLog entry
Comment 4 Eric Seidel (no email) 2009-06-04 20:52:29 PDT
Comment on attachment 30969 [details]
PlatformContextSkia : fix member initialization (fixed .patch)

I suggest we remove the initialization all together.  Vector will do the right thing by itself, we don't need to tell it to only allocate 1 slot by default.
Comment 5 Roland Steiner 2009-06-04 20:58:58 PDT
(In reply to comment #4)
I'm ok with that. It only occurred to me while browsing the code - I didn't question (or even research) the motivation behind it.
Comment 6 David Levin 2009-06-04 21:03:13 PDT
Comment on attachment 30971 [details]
ChangeLog entry

removed the r? from the changelog entry.
Comment 7 Roland Steiner 2009-06-04 21:21:11 PDT
Created attachment 30988 [details]
patch - remove variable initialization

cf. comment #4
Comment 8 Eric Seidel (no email) 2009-06-04 21:25:32 PDT
Comment on attachment 30988 [details]
patch - remove variable initialization

I would have just copied my comment instead of citing it. :)  But looks great!
Comment 9 Roland Steiner 2009-06-10 10:01:51 PDT
(In reply to comment #8)

Thanks - as I'm not a committer (yet!), could you please commit this for me as well?

Cheers,

Roland

Comment 10 Brent Fulgham 2009-06-10 11:16:49 PDT
Landed in @r44576.

Please don't remove the "Review by NOBODY (OOPS!)" from the ChangeLog.