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)
39
39
40
40
const char *params[] = {" arch" };
41
41
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));
44
46
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);
48
50
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
+ }
51
54
52
55
if (TARGET_AES)
53
56
jit_add_target_info (" target_feature" , " aes" );
You can’t perform that action at this time.
0 commit comments