This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit f2bc226d26b1a3ff00cc11b51e1f6c26b02cbeae
Author: wangmingrong1 <wangmingro...@xiaomi.com>
AuthorDate: Fri Feb 14 17:30:14 2025 +0800

    gcov: use lib_get_tempbuffer instead of using stack
    
    Signed-off-by: wangmingrong1 <wangmingro...@xiaomi.com>
---
 libs/libbuiltin/libgcc/gcov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libs/libbuiltin/libgcc/gcov.c b/libs/libbuiltin/libgcc/gcov.c
index 2b0edec71a..e9571ce97f 100644
--- a/libs/libbuiltin/libgcc/gcov.c
+++ b/libs/libbuiltin/libgcc/gcov.c
@@ -376,7 +376,7 @@ void __gcov_dump(void)
   FAR struct gcov_info *info;
   FAR const char *strip = getenv("GCOV_PREFIX_STRIP");
   FAR const char *prefix = getenv("GCOV_PREFIX");
-  FAR char new_path[PATH_MAX];
+  FAR char *new_path;
   FAR char *prefix2;
   int ret;
 
@@ -393,6 +393,7 @@ void __gcov_dump(void)
       return;
     }
 
+  new_path = lib_get_tempbuffer(PATH_MAX);
   for (info = __gcov_info_start; info; info = info->next)
     {
       FAR char *filename;
@@ -430,6 +431,7 @@ void __gcov_dump(void)
       lib_free(filename);
     }
 
+  lib_put_tempbuffer(new_path);
   lib_free(prefix2);
 }
 

Reply via email to