[Openmp-commits] [openmp] r347801 - [OpenMP] Minor cleanup of debug code
Jonathan Peyton via Openmp-commits
openmp-commits at lists.llvm.org
Wed Nov 28 12:18:06 PST 2018
Author: jlpeyton
Date: Wed Nov 28 12:18:06 2018
New Revision: 347801
URL: http://llvm.org/viewvc/llvm-project?rev=347801&view=rev
Log:
[OpenMP] Minor cleanup of debug code
* Fix calculation of string length.
* Remove NULL-check of pointer which has been dereferenced.
Patch by Andrey Churbanov
Differential Revision: https://reviews.llvm.org/D54948
Modified:
openmp/trunk/runtime/src/kmp_settings.cpp
Modified: openmp/trunk/runtime/src/kmp_settings.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.cpp?rev=347801&r1=347800&r2=347801&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.cpp (original)
+++ openmp/trunk/runtime/src/kmp_settings.cpp Wed Nov 28 12:18:06 2018
@@ -410,7 +410,7 @@ static void __kmp_stg_parse_par_range(ch
int *out_range, char *out_routine,
char *out_file, int *out_lb,
int *out_ub) {
- size_t len = KMP_STRLEN(value + 1);
+ size_t len = KMP_STRLEN(value) + 1;
par_range_to_print = (char *)KMP_INTERNAL_MALLOC(len + 1);
KMP_STRNCPY_S(par_range_to_print, len + 1, value, len + 1);
__kmp_par_range = +1;
@@ -418,7 +418,7 @@ static void __kmp_stg_parse_par_range(ch
__kmp_par_range_ub = INT_MAX;
for (;;) {
unsigned int len;
- if ((value == NULL) || (*value == '\0')) {
+ if (*value == '\0') {
break;
}
if (!__kmp_strcasecmp_with_sentinel("routine", value, '=')) {
More information about the Openmp-commits
mailing list