Bug 230743

Summary: IPC SimpleArgumentEncoder should static_assert(std::is_trivially_copyable<T>)
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, cdumez, darin, ggaren, kkinnunen, sam, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230714
Bug Depends on: 230744    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Kimmo Kinnunen 2021-09-24 01:47:53 PDT
IPC SimpleArgumentEncoder should static_assert(std::is_trivially_copyable<T>)
Comment 1 Radar WebKit Bug Importer 2021-10-01 01:48:17 PDT
<rdar://problem/83757335>
Comment 2 Chris Dumez 2021-10-05 12:49:43 PDT
Created attachment 440250 [details]
Patch
Comment 3 Kimmo Kinnunen 2021-10-06 04:16:26 PDT
Comment on attachment 440250 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440250&action=review

> Source/WebKit/Platform/IPC/ArgumentCoders.h:47
>      template<typename Encoder>

I think you should be able to assert once in the class scope.

template<typename T> struct SimpleArgumentCoder {
    static_assert(std::is_trivially_copyable_v<T>);
    ....
Comment 4 Chris Dumez 2021-10-06 07:30:55 PDT
Created attachment 440364 [details]
Patch
Comment 5 Chris Dumez 2021-10-06 07:31:03 PDT
(In reply to Kimmo Kinnunen from comment #3)
> Comment on attachment 440250 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440250&action=review
> 
> > Source/WebKit/Platform/IPC/ArgumentCoders.h:47
> >      template<typename Encoder>
> 
> I think you should be able to assert once in the class scope.
> 
> template<typename T> struct SimpleArgumentCoder {
>     static_assert(std::is_trivially_copyable_v<T>);
>     ....

Indeed, fixed.
Comment 6 EWS 2021-10-06 07:32:10 PDT
Kimmo Kinnunen found in /Volumes/Data/worker/Commit-Queue/build/Source/WebKit/ChangeLog does not appear to be a valid reviewer according to contributors.json.
/Volumes/Data/worker/Commit-Queue/build/Source/WebKit/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).
Comment 7 EWS 2021-10-06 08:21:38 PDT
Committed r283618 (242570@main): <https://commits.webkit.org/242570@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440364 [details].