[patch] to bug 88243

Koos Vriezen koos.vriezen at xs4all.nl
Thu Feb 10 23:08:42 GMT 2005


On Thu, Feb 10, 2005 at 11:17:44PM +0100, Paul Temple wrote:
> Please use this patch as the other one won't compile (I forgot 
> some braces after copy-pasting)

Are you sure this compiles w/o warningsss?

-    case DOMNode::AppendChild:
-      return getDOMNode(exec,node.appendChild(toNode(args[0])));
+    case DOMNode::AppendChild: {
+      Node* myNode = &(toNode(args[0]));
+      Value* gdNode = &(getDOMNode(exec,node.appendChild(*myNode)));
+      if (!myNode->handle()->closed()) myNode->handle()->close();
+      return *gdNode;
+    }

Looks to me you take an adress of a temporary with
  Node* myNode = &(toNode(args[0]));
that should be written as
  Node myNode = toNode(args[0]);
which also looks a lot less scary :-)

Koos




More information about the kfm-devel mailing list