[Webkit-unassigned] [Bug 117991] New: Fix cast-align warnings in FastMalloc.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 25 08:01:11 PDT 2013


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

           Summary: Fix cast-align warnings in FastMalloc.cpp
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ossy at webkit.org
                CC: oliver at apple.com, msaboff at apple.com,
                    mhahnenberg at apple.com


/home/oszi/WebKit/Source/WTF/wtf/FastMalloc.cpp:3167:102: warning: cast from 'char*' to 'uint32_t* {aka unsigned int*}' increases required alignment of target type [-Wcast-align]
/home/oszi/WebKit/Source/WTF/wtf/FastMalloc.cpp:3167:194: warning: cast from 'char*' to 'uint32_t* {aka unsigned int*}' increases required alignment of target type [-Wcast-align]
/home/oszi/WebKit/Source/WTF/wtf/FastMalloc.cpp:3167:305: warning: cast from 'char*' to 'uint32_t* {aka unsigned int*}' increases required alignment of target type [-Wcast-align]
/home/oszi/WebKit/Source/WTF/wtf/FastMalloc.cpp:3167:52: warning: cast from 'char*' to 'uint32_t* {aka unsigned int*}' increases required alignment of target type [-Wcast-align]

3167: POISON_DEALLOCATION_EXPLICIT(ptr, size, startPoison, endPoison);

#define POISON_DEALLOCATION_EXPLICIT(allocation, allocationSize, startPoison, endPoison) do { \
    ASSERT((allocationSize) >= 2 * sizeof(uint32_t)); \
    reinterpret_cast<uint32_t*>(allocation)[0] = 0xbadbeef9; \
    reinterpret_cast<uint32_t*>(allocation)[1] = 0xbadbeefb; \
    if ((allocationSize) < 4 * sizeof(uint32_t)) \
        break; \
    reinterpret_cast<uint32_t*>(allocation)[2] = (startPoison) ^ PTR_TO_UINT32(allocation); \
    reinterpret_cast<uint32_t*>(allocation)[END_POISON_INDEX(allocationSize)] = (endPoison) ^ PTR_TO_UINT32(allocation); \
} while (false)

This define introduced in 
- https://trac.webkit.org/changeset/143488/trunk/Source/WTF/wtf/FastMalloc.cpp
- https://trac.webkit.org/changeset/143996/trunk/Source/WTF/wtf/FastMalloc.cpp

The question is that ptr in line 3167 is uint32_t aligned or not?

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