[Webkit-unassigned] [Bug 173407] WTF::StringImpl::copyChars segfaults when built with GCC 7

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 15 09:33:12 PDT 2017


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

--- Comment #5 from JF Bastien <jfbastien at apple.com> ---
(In reply to Yusuke Suzuki from comment #3)
> (In reply to Konstantin Tokarev from comment #1)
> > I've run JSC benchmarks on Linux with GCC 7.1, performance results were
> > neutral after change of copyChars to do just memcpy
> 
> I like to use memcpy if it does not hurt performance.
> 
> Just out of curiosity, I wonder if we can use bitwise_cast here instead of
> reinterpret_cast.
> 
> Maybe, JF knows much about strict-aliasing, type punning and memcpy.

bitwise_cast wouldn't help here, the pointers would still alias. Making the pointer type char* would fix the problem, because char* is magical in C++ and ca alias everything.

memcpy sounds good if per isn't hurt.

Can source ever be the same as destination though? I want to make sure we don't need memmove instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170615/8afd578f/attachment.html>


More information about the webkit-unassigned mailing list