From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) by hurricane.the-brannons.com (Postfix) with ESMTPS id E997E78078 for ; Mon, 3 Feb 2014 04:23:56 -0800 (PST) Received: by mail-we0-f182.google.com with SMTP id u57so2124001wes.13 for ; Mon, 03 Feb 2014 04:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=gXcTbmjd+pIoIDgOYdeWU731BKsB4RTMFEPJ72Q1V+4=; b=thuLXdz9NDMf2qFwEk8gtnRuVrn6BMur/fCwGqrxq26K3j6k225nBOsQrhR3nxi/vL BmDD3QLw1I2y57INZrnl4STaUgTXoe0lYmEpZlkjejYKdTWSFNM1Nl077LqFJad2phX4 wQS74l7sC1VDOoUfNf1o5bimI5iYLgOpYSt+LGZ9vFpeuBICcLs1dWvEdRjbZLN9nL7P YnkQhxzAwKUfClu4YZDNu79QmyzZooo6Q4w18emVFH0Mzi/IIKi2kOnujrOtJB5C4pSa Sr510cKu1jy7OTlCm8Umoh1oY1RECeuLfra97AtFCrU8ZxfsBqyAT40gOZG0KVKdmCU8 J5Ug== X-Received: by 10.180.208.73 with SMTP id mc9mr8382005wic.54.1391430206962; Mon, 03 Feb 2014 04:23:26 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id uc9sm25347091wib.2.2014.02.03.04.23.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Feb 2014 04:23:26 -0800 (PST) Date: Mon, 3 Feb 2014 12:23:23 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140203122323.GE32200@toaster.adamthompson.me.uk> References: <20140102174906.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140102174906.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] What? How did this ever work? X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 12:23:57 -0000 On Sun, Feb 02, 2014 at 05:49:06PM -0500, Karl Dahlke wrote: > What does this do? > When I parse the html page I build a link list of tag structures, > one for each on the page. > Then at the end, buildTagArray copies them over into one linear array > for easy access. > Now I can get my hands on tag[17] easily. > But ... have a look at the structure htmlTag. > It has this member. > > struct htmlTag *controller; > > This usually points to the form that owns the tag. > So an input field, or a submit or reset button, > or radio button, they all point back to the form that contains it. > Ok but that's a pointer, and it points to the form tag > that was put into my link list. > When all those tags are copied over into the array, > the pointers are not updated. > They still point back to the structures in my link list. Yeah, but this array is an array of pointers to structs. However if things get reallocated then you'll get this divergence. Perhaps that's why t->controller is causing the weird jsrt segfault I was reporting. I'd always assumed it was some strange js and html interaction, but if something in what I'm doing is causing the form tag to be reallocated before I click the reset button then that'd explain the segfault with the t->controller pointer. Anyway, I'm glad you're going to sort this. Cheers, Adam.