Bug 234503 - [Win] MSVC reports "DumpRenderTree.cpp(633): error C2362: initialization of 'length' is skipped by 'goto exit'" with /std:c++20
Summary: [Win] MSVC reports "DumpRenderTree.cpp(633): error C2362: initialization of '...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 233448
  Show dependency treegraph
 
Reported: 2021-12-19 22:14 PST by Fujii Hironori
Modified: 2022-01-04 22:55 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.99 KB, patch)
2021-12-19 22:18 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch r287297 (3.13 KB, patch)
2021-12-20 12:46 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (2.01 KB, patch)
2021-12-21 17:05 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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