From: Tom Hughes Date: Thu, 16 Jun 2005 09:20:43 +0000 (+0000) Subject: Make sure redirects are fully initialised and add them to the resolved X-Git-Tag: svn/VALGRIND_3_0_0~401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3f8f5cbfe7ed7742a7e15901d6e6995bbd35377;p=thirdparty%2Fvalgrind.git Make sure redirects are fully initialised and add them to the resolved list straight away if they are resolved or we will wind up asserting. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3917 --- diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index fc73fa0131..1d2f296099 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -322,11 +322,15 @@ static void add_redirect_X_to_X( redir->type = R_REDIRECT; if (from_lib) redir->from_lib = VG_(arena_strdup)(VG_AR_SYMTAB, from_lib); + else redir->from_lib = NULL; if (from_sym) redir->from_sym = VG_(arena_strdup)(VG_AR_SYMTAB, from_sym); + else redir->from_sym = NULL; redir->from_addr = from_addr; if (to_lib) redir->to_lib = VG_(arena_strdup)(VG_AR_SYMTAB, to_lib); + else redir->to_lib = NULL; if (to_sym) redir->to_sym = VG_(arena_strdup)(VG_AR_SYMTAB, to_sym); + else redir->to_sym = NULL; redir->to_addr = to_addr; if (VG_(clo_verbosity) >= 2 && VG_(clo_trace_redir)) @@ -336,7 +340,10 @@ static void add_redirect_X_to_X( /* Check against all existing segments to see if this redirection can be resolved immediately */ - if (!resolve_redir_allsegs(redir)) { + if (VG_(is_resolved)(redir)) { + add_resolved(redir); + } + else if (!resolve_redir_allsegs(redir)) { /* nope, add to list */ redir->next = unresolved_redir; unresolved_redir = redir;