File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,18 @@ aarch64_jit_register_target_info (void)
3939
4040 const char *params[] = {" arch" };
4141 const char * local_cpu = host_detect_local_cpu (2 , params);
42- std::string arch = local_cpu;
43- free (const_cast <char *> (local_cpu));
42+ if (local_cpu != NULL )
43+ {
44+ std::string arch = local_cpu;
45+ free (const_cast <char *> (local_cpu));
4446
45- const char * arg = " -march=" ;
46- size_t arg_pos = arch.find (arg) + strlen (arg);
47- size_t end_pos = arch.find (" " , arg_pos);
47+ const char * arg = " -march=" ;
48+ size_t arg_pos = arch.find (arg) + strlen (arg);
49+ size_t end_pos = arch.find (" " , arg_pos);
4850
49- std::string cpu = arch.substr (arg_pos, end_pos - arg_pos);
50- jit_target_set_arch (cpu);
51+ std::string cpu = arch.substr (arg_pos, end_pos - arg_pos);
52+ jit_target_set_arch (cpu);
53+ }
5154
5255 if (TARGET_AES)
5356 jit_add_target_info (" target_feature" , " aes" );
You can’t perform that action at this time.
0 commit comments