diff --git a/rocclr/compiler/lib/utils/options.cpp b/rocclr/compiler/lib/utils/options.cpp index 9f58337698..6ca837afae 100644 --- a/rocclr/compiler/lib/utils/options.cpp +++ b/rocclr/compiler/lib/utils/options.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "options.hpp" namespace { @@ -1552,7 +1553,9 @@ Options::setDumpFileName(const char* val) } std::stringstream prefix; - prefix << dumpPrefix << "_" << buildNo << "_" << val; + // Replace characters in the file name that are not legal with '_'. + prefix << dumpPrefix << "_" << buildNo << "_" + << std::regex_replace(val, std::regex("[:]"), "_"); dumpFileRoot = prefix.str(); // Check whether the length of path meets the system limits