File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1177,6 +1177,10 @@ template <> struct ScalarTraits<memprof::GUIDHex64> {
11771177 Out << format (" 0x%016" PRIx64, (uint64_t )Val);
11781178 }
11791179 static StringRef input (StringRef Scalar, void *, memprof::GUIDHex64 &Val) {
1180+ // Reject decimal GUIDs.
1181+ if (all_of (Scalar, [](char C) { return std::isdigit (C); }))
1182+ return " use a hexadecimal GUID or a function instead" ;
1183+
11801184 uint64_t Num;
11811185 if (Scalar.starts_with_insensitive (" 0x" )) {
11821186 // Accept hexadecimal numbers starting with 0x or 0X.
Original file line number Diff line number Diff line change @@ -791,7 +791,7 @@ TEST(MemProf, YAMLParserGUID) {
791791
792792 // Verify the entire contents of MemProfData.Records.
793793 ASSERT_THAT (MemProfData.Records , SizeIs (1 ));
794- const auto &[GUID, Record] = * MemProfData.Records .begin ();
794+ const auto &[GUID, Record] = MemProfData.Records .front ();
795795 EXPECT_EQ (GUID, IndexedMemProfRecord::getGUID (" _Z3fooi" ));
796796 ASSERT_THAT (Record.AllocSites , SizeIs (1 ));
797797 EXPECT_EQ (Record.AllocSites [0 ].CSId , hashCallStack (CS1));
You can’t perform that action at this time.
0 commit comments