From: Petar Jovanovic Date: Fri, 15 Sep 2017 14:04:18 +0000 (+0200) Subject: mips: add clearing $ra to CLEAR_CALLER_SAVED_REGS macro X-Git-Tag: VALGRIND_3_14_0~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=211b0c303afc0dd0222ff8c6f73f1ab347120af2;p=thirdparty%2Fvalgrind.git mips: add clearing $ra to CLEAR_CALLER_SAVED_REGS macro Return address register belongs to caller saved registers, and compiler can use it to store temporary values. Clear it. --- diff --git a/memcheck/tests/leak.h b/memcheck/tests/leak.h index 7809aceae6..a1f93e8aaa 100644 --- a/memcheck/tests/leak.h +++ b/memcheck/tests/leak.h @@ -82,10 +82,11 @@ "move $15, $0 \n\t" /* t7 = 0 */ \ "move $24, $0 \n\t" /* t8 = 0 */ \ "move $25, $0 \n\t" /* t9 = 0 */ \ + "move $31, $0 \n\t" /* ra = 0 */ \ ".set pop \n\t" \ : : : "$1", "$2", "$3", "$4", "$5", "$6", "$7", \ "$8", "$9", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25"); \ + "$14", "$15", "$24", "$25", "$31"); \ } while (0) #elif (__mips == 64) #define CLEAR_CALLER_SAVED_REGS \ @@ -109,10 +110,11 @@ "move $15, $0 \n\t" /* t3 = 0 */ \ "move $24, $0 \n\t" /* t8 = 0 */ \ "move $25, $0 \n\t" /* t9 = 0 */ \ + "move $31, $0 \n\t" /* ra = 0 */ \ ".set pop \n\t" \ : : : "$1", "$2", "$3", "$4", "$5", "$6", "$7", \ "$8", "$9", "$10", "$11", "$12", "$13", \ - "$14", "$15", "$24", "$25"); \ + "$14", "$15", "$24", "$25", "$31"); \ } while (0) #else #define CLEAR_CALLER_SAVED_REGS /*nothing*/