[Webkit-unassigned] [Bug 104613] [WK2] Fix memory sampler for ARM Linux

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 8 19:56:18 PST 2013


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


Benjamin Poulain <benjamin at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #178689|review?                     |review-
               Flag|                            |




--- Comment #6 from Benjamin Poulain <benjamin at webkit.org>  2013-01-08 19:58:12 PST ---
(From update of attachment 178689)
View in context: https://bugs.webkit.org/attachment.cgi?id=178689&action=review

> Source/WebKit2/ChangeLog:11
> +
> +        Make sure that the return value for fgetc() is first assigned to a
> +        signed variable to check for EOF and avoid the potential for an infinite
> +        loop. This is important for ARM platforms where "char" type is
> +        unsigned by default.

This whole signed-unsigned char is not the problem. The problem is the assignment from fgetc() was a one with loss. It is incorrect, ARM or not.

> Source/WebKit2/Shared/linux/WebMemorySamplerLinux.cpp:70
> +    int ch;
> +    while ((index < maxBuffer) && (ch = fgetc(file) != EOF)) {
> +        char charCode = ch;
> +        if (isASCIISpace(charCode) && index) // Break on non-initial ASCII space.

This code is harder to read than it should.

Please split your condition and assignment to make something nice and clean.
You probably also want a c++ cast for int->char to make it explicit.

-- 
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