Skip to content

Commit

Permalink
[stable] [vm] Ensure CpuInfo Windows flag detection works.
Browse files Browse the repository at this point in the history
BUG=flutter/flutter#140138
BUG=flutter/flutter#138784
BUG=flutter/flutter#138693
TEST=manually on win x64 with `__ int3();` added in front of `roundsd` and forced `CpuId::sse41=false;`
Change-Id: I9e2dbf2615549dcc7c979036b5442276c2e0fb29
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/357218
Cherry-pick-request: #55211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358040
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Alexander Aprelev <[email protected]>
  • Loading branch information
aam authored and Commit Queue committed Mar 19, 2024
1 parent bc4150a commit 4b5c0cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.3.3

This is a patch release that:

- Fixes an issue where dart vm crashed when running on pre-SSE41 older CPUs on Windows (issue [#140138][]).

[#140138]: https://github.com/flutter/flutter/issues/140138

## 3.3.2 - 2024-03-20

This is a patch release that:
Expand Down
6 changes: 5 additions & 1 deletion runtime/vm/cpuinfo_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ void CpuInfo::Cleanup() {

bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) {
if (method_ == kCpuInfoCpuId) {
return CpuId::field(idx);
const char* field = CpuId::field(idx);
if (field == nullptr) return false;
bool contains = (strstr(field, search_string) != nullptr);
free(const_cast<char*>(field));
return contains;
} else {
UNREACHABLE();
}
Expand Down

0 comments on commit 4b5c0cd

Please sign in to comment.