|
From: <sv...@va...> - 2014-09-02 22:20:22
|
Author: philippe
Date: Tue Sep 2 22:20:14 2014
New Revision: 14438
Log:
gcc on arm64 -Og produces a (false positive) warning that
stackPos might be used uninitialised.
Silence gcc by assigning a value to stackPos.
This value must be overriden if a stack description is found.
The fact that the value is overriden is asserted.
Modified:
trunk/coregrind/m_addrinfo.c
Modified: trunk/coregrind/m_addrinfo.c
==============================================================================
--- trunk/coregrind/m_addrinfo.c (original)
+++ trunk/coregrind/m_addrinfo.c Tue Sep 2 22:20:14 2014
@@ -228,7 +228,9 @@
too small). */
{
ThreadId tid;
- StackPos stackPos;
+ StackPos stackPos = StackPos_stacked;
+ // Default init to StackPos_stacked, to silence gcc warning.
+ // We assert this value is overriden if a stack descr is produced.
// First try to find a tid with stack containing a
tid = find_tid_with_stack_containing (a);
@@ -256,6 +258,7 @@
ai->Addr.Stack.tinfo.tid = tid;
ai->Addr.Stack.IP = 0;
ai->Addr.Stack.frameNo = -1;
+ vg_assert (stackPos != StackPos_stacked);
ai->Addr.Stack.stackPos = stackPos;
vg_assert (a < VG_(get_SP)(tid));
ai->Addr.Stack.spoffset = a - VG_(get_SP)(tid);
|