Ignore:
Timestamp:
Oct 28, 2009, 1:07:21 PM (16 years ago)
Author:
[email protected]
Message:

2009-10-24 Martin Robinson <[email protected]>

Reviewed by Oliver Hunt.

Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast.

strict-aliasing warnings in JSFunction.h
https://bugs.webkit.org/show_bug.cgi?id=27869

  • runtime/JSFunction.h: (JSC::JSFunction::nativeFunction): (JSC::JSFunction::scopeChain): (JSC::JSFunction::setScopeChain): (JSC::JSFunction::setNativeFunction):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSFunction.h

    r49721 r50232  
    6767        NativeFunction nativeFunction()
    6868        {
    69             return *reinterpret_cast<NativeFunction*>(m_data);
     69            return *WTF::bitwise_cast<NativeFunction*>(m_data);
    7070        }
    7171
     
    9898        {
    9999            ASSERT(!isHostFunctionNonInline());
    100             return *reinterpret_cast<ScopeChain*>(m_data);
     100            return *WTF::bitwise_cast<ScopeChain*>(m_data);
    101101        }
    102102        void clearScopeChain()
     
    113113        {
    114114            ASSERT(!isHostFunctionNonInline());
    115             *reinterpret_cast<ScopeChain*>(m_data) = sc;
     115            *WTF::bitwise_cast<ScopeChain*>(m_data) = sc;
    116116        }
    117117        void setNativeFunction(NativeFunction func)
    118118        {
    119             *reinterpret_cast<NativeFunction*>(m_data) = func;
     119            *WTF::bitwise_cast<NativeFunction*>(m_data) = func;
    120120        }
    121121        unsigned char m_data[sizeof(void*)];
Note: See TracChangeset for help on using the changeset viewer.