]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make sure redirects are fully initialised and add them to the resolved
authorTom Hughes <tom@compton.nu>
Thu, 16 Jun 2005 09:20:43 +0000 (09:20 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 16 Jun 2005 09:20:43 +0000 (09:20 +0000)
list straight away if they are resolved or we will wind up asserting.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3917

coregrind/m_redir.c

index fc73fa01315fef8ed48659faaea93978bd831e10..1d2f296099c33d39af299dd6781ac4d6d9b7b071 100644 (file)
@@ -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;