-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[qtwebengine] Fix VS2022 ICE #24532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[qtwebengine] Fix VS2022 ICE #24532
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| From 0ce5e91bdfa2cd7cac247911b9e8c4404c114937 Mon Sep 17 00:00:00 2001 | ||
| From: Peter Varga <pvarga@inf.u-szeged.hu> | ||
| Date: Thu, 21 Apr 2022 08:49:53 +0200 | ||
| Subject: [PATCH] Workaround MSVC2022 ICE in constexpr functions | ||
|
|
||
| It happens around initialization of STL containers in a constexpr | ||
| function. In this case, aggregate initialization of std::array with | ||
| double braces seems to cause the crash. | ||
|
|
||
| For some reason it doesn't seem to happen in 98-based. This workaround | ||
| can be reverted after Microsoft fixes the issue: | ||
| https://developercommunity.visualstudio.com/t/fatal-error-C1001:-Internal-compiler-err/1669485 | ||
|
|
||
| Change-Id: I6bc2c71d328691cc74bc53c6d62f3d5df519b81e | ||
| Pick-to: 90-based | ||
| Fixes: QTBUG-101917 | ||
| Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> | ||
| --- | ||
|
|
||
| diff --git a/chromium/base/hash/md5_constexpr_internal.h b/chromium/base/hash/md5_constexpr_internal.h | ||
| index b705bc8..5c9c004 100644 | ||
| --- a/chromium/base/hash/md5_constexpr_internal.h | ||
| +++ b/chromium/base/hash/md5_constexpr_internal.h | ||
| @@ -281,15 +281,63 @@ | ||
| return IntermediateDataToMD5Digest(ProcessMessage(data, n)); | ||
| } | ||
|
|
||
| - static constexpr uint64_t Hash64(const char* data, uint32_t n) { | ||
| - IntermediateData intermediate = ProcessMessage(data, n); | ||
| - return (static_cast<uint64_t>(SwapEndian(intermediate.a)) << 32) | | ||
| - static_cast<uint64_t>(SwapEndian(intermediate.b)); | ||
| + static constexpr uint64_t Hash64(const char* message, uint32_t n) { | ||
| + const uint32_t m = GetPaddedMessageLength(n); | ||
| + IntermediateData intermediate0 = kInitialIntermediateData; | ||
| + for (uint32_t offset = 0; offset < m; offset += 64) { | ||
| + RoundData data = { | ||
| + GetPaddedMessageWord(message, n, m, offset), | ||
| + GetPaddedMessageWord(message, n, m, offset + 4), | ||
| + GetPaddedMessageWord(message, n, m, offset + 8), | ||
| + GetPaddedMessageWord(message, n, m, offset + 12), | ||
| + GetPaddedMessageWord(message, n, m, offset + 16), | ||
| + GetPaddedMessageWord(message, n, m, offset + 20), | ||
| + GetPaddedMessageWord(message, n, m, offset + 24), | ||
| + GetPaddedMessageWord(message, n, m, offset + 28), | ||
| + GetPaddedMessageWord(message, n, m, offset + 32), | ||
| + GetPaddedMessageWord(message, n, m, offset + 36), | ||
| + GetPaddedMessageWord(message, n, m, offset + 40), | ||
| + GetPaddedMessageWord(message, n, m, offset + 44), | ||
| + GetPaddedMessageWord(message, n, m, offset + 48), | ||
| + GetPaddedMessageWord(message, n, m, offset + 52), | ||
| + GetPaddedMessageWord(message, n, m, offset + 56), | ||
| + GetPaddedMessageWord(message, n, m, offset + 60)}; | ||
| + IntermediateData intermediate1 = intermediate0; | ||
| + for (uint32_t i = 0; i < 64; ++i) | ||
| + intermediate1 = ApplyStep(i, data, intermediate1); | ||
| + intermediate0 = Add(intermediate0, intermediate1); | ||
| + } | ||
| + return (static_cast<uint64_t>(SwapEndian(intermediate0.a)) << 32) | | ||
| + static_cast<uint64_t>(SwapEndian(intermediate0.b)); | ||
| } | ||
|
|
||
| - static constexpr uint32_t Hash32(const char* data, uint32_t n) { | ||
| - IntermediateData intermediate = ProcessMessage(data, n); | ||
| - return SwapEndian(intermediate.a); | ||
| + static constexpr uint32_t Hash32(const char* message, uint32_t n) { | ||
| + const uint32_t m = GetPaddedMessageLength(n); | ||
| + IntermediateData intermediate0 = kInitialIntermediateData; | ||
| + for (uint32_t offset = 0; offset < m; offset += 64) { | ||
| + RoundData data = { | ||
| + GetPaddedMessageWord(message, n, m, offset), | ||
| + GetPaddedMessageWord(message, n, m, offset + 4), | ||
| + GetPaddedMessageWord(message, n, m, offset + 8), | ||
| + GetPaddedMessageWord(message, n, m, offset + 12), | ||
| + GetPaddedMessageWord(message, n, m, offset + 16), | ||
| + GetPaddedMessageWord(message, n, m, offset + 20), | ||
| + GetPaddedMessageWord(message, n, m, offset + 24), | ||
| + GetPaddedMessageWord(message, n, m, offset + 28), | ||
| + GetPaddedMessageWord(message, n, m, offset + 32), | ||
| + GetPaddedMessageWord(message, n, m, offset + 36), | ||
| + GetPaddedMessageWord(message, n, m, offset + 40), | ||
| + GetPaddedMessageWord(message, n, m, offset + 44), | ||
| + GetPaddedMessageWord(message, n, m, offset + 48), | ||
| + GetPaddedMessageWord(message, n, m, offset + 52), | ||
| + GetPaddedMessageWord(message, n, m, offset + 56), | ||
| + GetPaddedMessageWord(message, n, m, offset + 60)}; | ||
| + IntermediateData intermediate1 = intermediate0; | ||
| + for (uint32_t i = 0; i < 64; ++i) | ||
| + intermediate1 = ApplyStep(i, data, intermediate1); | ||
| + intermediate0 = Add(intermediate0, intermediate1); | ||
| + } | ||
| + return SwapEndian(intermediate0.a); | ||
| } | ||
| }; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BillyONeal Is there a clever way to make CI return these logs?
https://dev.azure.com/vcpkg/public/_build/results?buildId=71640&view=logs&jobId=7922e5c4-0103-5f8f-ad17-45ce9bb98e80&j=7922e5c4-0103-5f8f-ad17-45ce9bb98e80&t=491b9f02-7edc-5990-cda1-511e95a3768e was successful but the host build seems to fail sometimes in other triplets (at least in the latest CI) run other than
x64-windows