commit | f181b502493a90d8e9cc79feae77f9c7d90e0c1c | [log] [tgz] |
---|---|---|
author | Ryan Macnak <rmacnak@google.com> | Thu Dec 15 17:36:39 2022 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Dec 15 17:36:39 2022 +0000 |
tree | 5976e8c284bb9beea4032ef84b5291e83d829b75 | |
parent | ff2d661d5ba07766fc27196e98df6c6ae80444b9 [diff] |
[build] Address warnings in gcc 11 and 12. TEST=local builds Bug: https://github.com/dart-lang/sdk/issues/50645 Change-Id: If6cd26620feff06abd449be0f7d1dd1e620b8411 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275841 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/cpuinfo_linux.cc b/runtime/vm/cpuinfo_linux.cc index 27cc16e..22e86cb 100644 --- a/runtime/vm/cpuinfo_linux.cc +++ b/runtime/vm/cpuinfo_linux.cc
@@ -67,6 +67,7 @@ bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) { if (method_ == kCpuInfoCpuId) { const char* field = CpuId::field(idx); + if (field == NULL) return false; bool contains = (strstr(field, search_string) != NULL); free(const_cast<char*>(field)); return contains;
diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc index c11a5fa..912eb13 100644 --- a/runtime/vm/image_snapshot.cc +++ b/runtime/vm/image_snapshot.cc
@@ -640,6 +640,7 @@ case ProgramSection::BuildId: return kSnapshotBuildIdAsmSymbol; } + UNREACHABLE(); return nullptr; }