[Webkit-unassigned] [Bug 42058] [BREWMP] Build fix: Use PassOwnPtr's leakPtr

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 12 13:47:51 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42058





--- Comment #4 from Darin Adler <darin at apple.com>  2010-07-12 13:47:52 PST ---
(From update of attachment 61194)
> @@ -144,7 +144,7 @@ static bool makeAllDirectories(PassOwnPt
>      }
>  
>      if (lastDivPos > 0) {
> -        if (!makeAllDirectories(fileMgr.release(), path.substring(0, lastDivPos)))
> +        if (!makeAllDirectories(fileMgr.leakPtr(), path.substring(0, lastDivPos)))
>              return false;

This is buggy and needs a change in design. If this function fails, you'll be left with 0 in fileMgr and not be able to complete the function. Since makeAllDirectories takes a pointer to an object that it destroys, it can't call itself, and then go on to use that object. We'll need to refactor this code to find the mistake.

You could get this to compile by just passing fileMgr here. That would change the behavior back to what it was before, but there is a bug here because fileMgr will be 0 once it's passed to another PassOwnPtr.

> -    return makeAllDirectories(fileMgr.release(), canonicalPath(path));
> +    return makeAllDirectories(fileMgr.leakPtr(), canonicalPath(path));

This code was correct before. fileMgr here is an OwnPtr, and calling release on it gives you a PassOwnPtr, which is exactly what you need to call makeAllDirectories.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list