mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8214773: Replace use of thread unsafe strtok
Reviewed-by: thartmann, dholmes
This commit is contained in:
parent
a1c8528d3f
commit
4246096355
5 changed files with 17 additions and 9 deletions
|
@ -398,13 +398,14 @@ bool DirectiveSet::is_intrinsic_disabled(const methodHandle& method) {
|
|||
size_t length = strlen(DisableIntrinsicOption);
|
||||
char* local_list = NEW_RESOURCE_ARRAY(char, length + 1);
|
||||
strncpy(local_list, DisableIntrinsicOption, length + 1);
|
||||
char* save_ptr;
|
||||
|
||||
char* token = strtok(local_list, ",");
|
||||
char* token = strtok_r(local_list, ",", &save_ptr);
|
||||
while (token != NULL) {
|
||||
if (strcmp(token, vmIntrinsics::name_at(id)) == 0) {
|
||||
return true;
|
||||
} else {
|
||||
token = strtok(NULL, ",");
|
||||
token = strtok_r(NULL, ",", &save_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue