Fix bug where freed std::string memory would sometimes still be accessed.
This commit is contained in:
2
ispc.cpp
2
ispc.cpp
@@ -75,7 +75,7 @@ Target::GetTarget(const char *arch, const char *cpu, const char *isa,
|
||||
if (cpu == NULL) {
|
||||
std::string hostCPU = llvm::sys::getHostCPUName();
|
||||
if (hostCPU.size() > 0)
|
||||
cpu = hostCPU.c_str();
|
||||
cpu = strdup(hostCPU.c_str());
|
||||
else {
|
||||
fprintf(stderr, "Warning: unable to determine host CPU!\n");
|
||||
cpu = "generic";
|
||||
|
||||
Reference in New Issue
Block a user