From ae693fc3f1516b0cf2b48c1d32d0c085e7be0689 Mon Sep 17 00:00:00 2001
From: Thibaut Benjamin <thibaut.benjamin@gmail.com>
Date: Wed, 6 Apr 2022 15:45:20 +0200
Subject: [PATCH] [e-acsl] add comment

---
 .../segment_model/e_acsl_shadow_concurrency.c                  | 3 +++
 .../observation_model/segment_model/e_acsl_shadow_layout.c     | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_concurrency.c b/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_concurrency.c
index 2292d2f6f17..3d92f1977f8 100644
--- a/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_concurrency.c
+++ b/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_concurrency.c
@@ -183,6 +183,9 @@ static void fill_thread_layout_stack(memory_partition *pstack,
 static void fill_thread_layout_tls(memory_partition *ptls) {
   // Since the TLS is by design specific to each thread, we can reuse the
   // method used to identify the TLS segment in the main thread
+  // We first need to collect the safe locations of the current thread,
+  // since we need to register them in case the program uses one of them
+  // inside the thread
   collect_safe_locations();
   set_application_segment(&ptls->application, get_tls_start(0), get_tls_size(),
                           "thread_tls", NULL);
diff --git a/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_layout.c b/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_layout.c
index 3578bc01584..15870873f1a 100644
--- a/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_layout.c
+++ b/src/plugins/e-acsl/share/e-acsl/observation_model/segment_model/e_acsl_shadow_layout.c
@@ -362,6 +362,7 @@ static void init_shadow_layout_global() {
 
 static void init_shadow_layout_tls() {
   memory_partition *ptls = &mem_layout.tls;
+  /* Collect the safe locations of the main thread */
   collect_safe_locations();
   init_tls_size();
   set_application_segment(&ptls->application, get_tls_start(1), get_tls_size(),
-- 
GitLab