]> granicus.if.org Git - gc/commitdiff
Workaround 'cnt var assigned but not used' cppcheck FP in copy_ptr_regs
authorIvan Maidanski <ivmai@mail.ru>
Tue, 10 Sep 2019 20:28:15 +0000 (23:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 10 Sep 2019 20:28:15 +0000 (23:28 +0300)
(fix of commit 912ec408d)

* win32_threads.c [!I386 && !X86_64 && !ARM32 && !AARCH64 && !SHx
&& !MIPS && !PPC && !ALPHA && CPPCHECK] (copy_ptr_regs): Set sp to cnt
value (with a cast); add comment.

win32_threads.c

index 5a35e70d61c0182d745163ce1f53f1d21ddbcfa3..f6049b39934b4afbf1601b4fe4d61e3a38c127f0 100644 (file)
@@ -1566,7 +1566,9 @@ static ptr_t copy_ptr_regs(word *regs, const CONTEXT *pcontext) {
       PUSH4(IntA0,IntA1,IntA2,IntA3), PUSH4(IntA4,IntA5,IntT8,IntT9);
       PUSH4(IntT10,IntT11,IntT12,IntAt);
       sp = (ptr_t)context.IntSp;
-#   elif !defined(CPPCHECK)
+#   elif defined(CPPCHECK)
+      sp = (ptr_t)(word)cnt; /* to workaround "cnt not used" false positive */
+#   else
 #     error Architecture is not supported
 #   endif
 #   undef context