[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/khtml/ecma
From:       Maks Orlovich <mo85 () cornell ! edu>
Date:       2006-04-28 2:30:40
Message-ID: 200604272230.41115.mo85 () cornell ! edu
[Download RAW message or body]

On Thursday 27 April 2006 19:12, Dirk Mueller wrote:
> SVN commit 534859 by mueller:
>
> better fix both CID's at the same time. Thanks Maksim.

Actually, the check is not needed, and the warning is a false positive:
info simply can't be null here. This method's invocation occurs only if 
line 247 executes, and in a sequence when no change to document is possible. 
That line, of course, is involved only if info would not be null here.



>
>
>  M  +2 -2      kjs_html.cpp
>
>
> --- trunk/KDE/kdelibs/khtml/ecma/kjs_html.cpp #534858:534859
> @@ -287,14 +287,14 @@
>
>    //Return named items under document (e.g. images, applets, etc.)
>    ElementMappingCache::ItemInfo* info =
> docImpl->underDocNamedCache().get(propertyName.qstring()); -  if (info->nd)
> +  if (info && info->nd)
>      return getDOMNode(exec, info->nd);
>    else {
>      //No cached mapping, do it the hard way..
>      DOM::HTMLMappedNameCollectionImpl* coll = new
> DOM::HTMLMappedNameCollectionImpl(docImpl,
> HTMLCollectionImpl::DOCUMENT_NAMED_ITEMS, propertyName.domString());
>
> -    if (coll->length() == 1) {
> +    if (info && coll->length() == 1) {
>          info->nd = static_cast<DOM::ElementImpl*>(coll->firstItem());
>          delete coll;
>          return getDOMNode(exec, info->nd);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic