From c8ae3f2797d9c613e07b916683c51efea2da81aa Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Sun, 19 Oct 2014 17:21:09 +0200 Subject: Fix bug in FreeBSD topology detection code Code incorrectly relied on undefined C behavior. Clang and gcc 4.9 do not behave as code expected. This affected cores and processors detection on FreeBSD. --- erts/lib_src/common/erl_misc_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts') diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c index d58a28b5cb..7833dd8219 100644 --- a/erts/lib_src/common/erl_misc_utils.c +++ b/erts/lib_src/common/erl_misc_utils.c @@ -1515,7 +1515,7 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml, if (is_thread_group) { thread++; } else { - *core_p = (*core_p)++; + *core_p = (*core_p) + 1; } index_procs++; } @@ -1535,9 +1535,9 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml, if (parentCacheLevel == 0) { *core_p = 0; - *processor_p = (*processor_p)++; + *processor_p = (*processor_p) + 1; } else { - *core_p = (*core_p)++; + *core_p = (*core_p) + 1; } if (error) -- cgit v1.2.3