Bug 34169

Summary: Using the same name for member variables and parameters in NewThreadContext constructor cause failure to initialize
Product: WebKit Reporter: Lyon Chen <lyon.chen>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, darin, mjs, mrowe, yong.li.webkit
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch for bug 34169. none

Lyon Chen
Reported 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.
Attachments
Patch for bug 34169. (1.25 KB, patch)
2010-01-26 09:40 PST, Lyon Chen
no flags
Lyon Chen
Comment 1 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.
Darin Adler
Comment 2 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!
Lyon Chen
Comment 3 2010-01-26 10:39:20 PST
Hmmm, yeah, seems problem is elsewhere, will check further.
Alexey Proskuryakov
Comment 4 2010-01-26 10:43:19 PST
Yes, this is certainly a valid C++ idiom that we use frequently.
Alexey Proskuryakov
Comment 5 2010-03-03 16:23:56 PST
Closing for now per comment 3. Please feel free to reopen if this is still needed.
Note You need to log in before you can comment on or make changes to this bug.