Bug 43619

Summary: Bitmap.h has no default constructor
Product: WebKit Reporter: Zoltan Herczeg <zherczeg>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, ademar, ossy, yael
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41177    
Attachments:
Description Flags
patch
ggaren: review-
patch v2 eric: review+

Zoltan Herczeg
Reported 2010-08-06 05:57:15 PDT
The bitmap array is not cleared, and contains a memory garbage after init.
Attachments
patch (1.95 KB, patch)
2010-08-06 07:11 PDT, Zoltan Herczeg
ggaren: review-
patch v2 (1.75 KB, patch)
2010-08-06 12:04 PDT, Zoltan Herczeg
eric: review+
Zoltan Herczeg
Comment 1 2010-08-06 07:11:43 PDT
Geoffrey Garen
Comment 2 2010-08-06 10:45:37 PDT
Comment on attachment 63718 [details] patch Nice catch. JavaScriptCore/wtf/Bitmap.h:35 + Bitmap(bool initializationNeeded = true); WebKit is moving toward a policy of considering boolean arguments to functions to be a bad design pattern. I think we may eventually discourage or forbid them in our coding style guidelines. The problem with this kind of argument is that it's very hard to tell, at the callsite, exactly what "true" or "false" might mean. I think you should just remove the boolean argument here. If we do want to take advantage of an optimized "no initialization" bitmap in the future, let's add an extra constructor akin to the AdoptCFTag constructor for RetainPtr, or the VPtrStealingHackType constructor for JSString. Otherwise, this patch is great!
Zoltan Herczeg
Comment 3 2010-08-06 12:04:47 PDT
Created attachment 63748 [details] patch v2
Eric Seidel (no email)
Comment 4 2010-08-06 13:31:05 PDT
Comment on attachment 63748 [details] patch v2 LGTM.
Zoltan Herczeg
Comment 5 2010-08-07 10:37:35 PDT
Yael
Comment 6 2010-12-02 12:21:45 PST
This is the fix I was about to suggest for https://qtrequirements.europe.nokia.com/browse/BR-4872, just to find that it was already fixed. :-(
Ademar Reis
Comment 7 2010-12-02 12:47:18 PST
Revision r64912 cherry-picked into qtwebkit-2.1 with commit 67daffa <http://gitorious.org/webkit/qtwebkit/commit/67daffa>
Note You need to log in before you can comment on or make changes to this bug.