Bug 34169 - Using the same name for member variables and parameters in NewThreadContext constructor cause failure to initialize
Summary: Using the same name for member variables and parameters in NewThreadContext c...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-26 09:27 PST by Lyon Chen
Modified: 2010-03-03 16:23 PST (History)
5 users (show)

See Also:


Attachments
Patch for bug 34169. (1.25 KB, patch)
2010-01-26 09:40 PST, Lyon Chen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lyon Chen 2010-01-26 09:27:40 PST
In file JavaScriptCore/wtf/Threading.cpp, the constructor of NewThreadContext use the same name for all the parameters and memeber variables, and this cause the member variables not initialized in RVCT compiler, not sure about other compilers though.

Change it to use different names should be fine with other compilers too.
Comment 1 Lyon Chen 2010-01-26 09:40:24 PST
Created attachment 47417 [details]
Patch for bug 34169.

Use different parameter name for NewThreadContext, this fix the not-initialized member variable issue for RVCT compiler.
Comment 2 Darin Adler 2010-01-26 10:37:19 PST
We do this, using the same name for arguments and data members, in tons of different places in the code base. This is just one of them!
Comment 3 Lyon Chen 2010-01-26 10:39:20 PST
Hmmm, yeah, seems problem is elsewhere, will check further.
Comment 4 Alexey Proskuryakov 2010-01-26 10:43:19 PST
Yes, this is certainly a valid C++ idiom that we use frequently.
Comment 5 Alexey Proskuryakov 2010-03-03 16:23:56 PST
Closing for now per comment 3. Please feel free to reopen if this is still needed.