mirror of
https://github.com/dart-lang/sdk
synced 2024-10-15 00:28:05 +00:00
[vm] Ensure CpuInfo Windows flag detection works.
Fixes https://github.com/flutter/flutter/issues/140138 TEST=manually on win x64 with `__ int3();` added in front of `roundsd` and forced `CpuId::sse41=false;` Change-Id: I9e2dbf2615549dcc7c979036b5442276c2e0fb29 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357218 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
parent
94abcc81ab
commit
c5946a1195
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue