[Webkit-unassigned] [Bug 50277] key member variable in NumericStrings CacheData is never initialized

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 30 16:27:03 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50277


Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xan.lopez at gmail.com




--- Comment #3 from Xan Lopez <xan.lopez at gmail.com>  2010-11-30 16:27:02 PST ---
(In reply to comment #2)
> (From update of attachment 75213 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75213&action=review
> 
> This patch doesn't fix a bug. There is no symptom. While the key has a random value in it, the value is guaranteed to have a null string, and the code always checks that.
> 
> I suspect this patch just makes a memory debugging tool stop complaining. Is there some other way to accomplish that without generating a lot of code that will run whenever we construct a JSGlobalData object?

It's true that basically this can never result in any problem as the code is now, since the UString will have a null value at first and the code checks for that. It's just probably a good idea to shut up valgrind and protect ourselves against future refactorings where this could become an issue.

> 
> > JavaScriptCore/runtime/NumericStrings.h:81
> > +            CacheEntry()
> > +            : key(0)
> > +            {
> > +            }
> 
> Initializing to zero is not all that helpful; zero itself has a cached string.

Right, but because of the UString check in the if things will still work properly (the first time it will introduced, after that it will be returned from the cache). In any case as I said I realize this is not ideal.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list