mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 00:15:04 -05:00
#2123 Ignore regex exception.
This commit is contained in:
@@ -230,14 +230,16 @@ void xmrig::DmiMemory::setId(const char *slot, const char *bank)
|
|||||||
m_slot = slot;
|
m_slot = slot;
|
||||||
m_bank = bank;
|
m_bank = bank;
|
||||||
|
|
||||||
std::cmatch cm;
|
try {
|
||||||
if (std::regex_match(slot, cm, std::regex("^Channel([A-Z])[-_]DIMM(\\d+)$", std::regex_constants::icase))) {
|
std::cmatch cm;
|
||||||
m_id = fmt::format(kIdFormat, cm.str(1), cm.str(2)).c_str();
|
if (std::regex_match(slot, cm, std::regex("^Channel([A-Z])[-_]DIMM(\\d+)$", std::regex_constants::icase))) {
|
||||||
}
|
m_id = fmt::format(kIdFormat, cm.str(1), cm.str(2)).c_str();
|
||||||
else if (std::regex_search(bank, cm, std::regex("CHANNEL ([A-Z])$"))) {
|
|
||||||
std::cmatch cm2;
|
|
||||||
if (std::regex_match(slot, cm2, std::regex("^DIMM (\\d+)$"))) {
|
|
||||||
m_id = fmt::format(kIdFormat, cm.str(1), cm2.str(1)).c_str();
|
|
||||||
}
|
}
|
||||||
}
|
else if (std::regex_search(bank, cm, std::regex("CHANNEL ([A-Z])$"))) {
|
||||||
|
std::cmatch cm2;
|
||||||
|
if (std::regex_match(slot, cm2, std::regex("^DIMM (\\d+)$"))) {
|
||||||
|
m_id = fmt::format(kIdFormat, cm.str(1), cm2.str(1)).c_str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (...) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user