Bug 234503

Summary: [Win] MSVC reports "DumpRenderTree.cpp(633): error C2362: initialization of 'length' is skipped by 'goto exit'" with /std:c++20
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Tools / TestsAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, don.olmstead, ross.kirsling, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 233448    
Attachments:
Description Flags
Patch
none
Patch r287297
none
Patch none

Description Fujii Hironori 2021-12-19 22:14:57 PST
[Win] MSVC reports "DumpRenderTree.cpp(633): error C2362: initialization of 'length' is skipped by 'goto exit'" with /std:c++20

> Tools\DumpRenderTree\win\DumpRenderTree.cpp(633): error C2362: initialization of 'length' is skipped by 'goto exit'
> Tools\DumpRenderTree\win\DumpRenderTree.cpp(611): note: see declaration of 'length'
> Tools\DumpRenderTree\win\DumpRenderTree.cpp(633): note: see declaration of 'exit'
Comment 1 Fujii Hironori 2021-12-19 22:18:37 PST
Created attachment 447583 [details]
Patch
Comment 2 Fujii Hironori 2021-12-20 12:46:44 PST
Created attachment 447621 [details]
Patch r287297
Comment 3 Fujii Hironori 2021-12-20 20:52:29 PST
Comment on attachment 447621 [details]
Patch r287297

Clearing flags on attachment: 447621

Committed r287297 (245449@trunk): <https://commits.webkit.org/245449@trunk>
Comment 4 Fujii Hironori 2021-12-20 20:52:33 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2021-12-20 20:53:16 PST
<rdar://problem/86752706>
Comment 6 Darin Adler 2021-12-21 01:20:34 PST
Comment on attachment 447621 [details]
Patch r287297

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

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:597
> +    SAFEARRAY* arraryPtr;

"array" is good, but "arrary" not so good

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:605
> +    std::unique_ptr<SAFEARRAY, decltype(deleter)> array(arraryPtr, deleter);

I suspect we can rely on deduction guides and just write std::unique_ptr here without the template arguments.
Comment 7 Fujii Hironori 2021-12-21 02:27:23 PST
Reopened.
Comment 8 Fujii Hironori 2021-12-21 17:05:13 PST
Created attachment 447766 [details]
Patch
Comment 9 Fujii Hironori 2022-01-04 22:53:10 PST
Comment on attachment 447766 [details]
Patch

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

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:602
> +        if (SUCCEEDED(::SafeArrayUnlock(arrayPtr)))

This code has another bug. I'm going to fix this typo and the bug in the following ticket.
Bug 234870 – [Win][DumpRenderTree] dumpHistoryItem leaks a SafeArray