From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqNqI-0006LX-U5 for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqNqF-0004yV-Il for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:40:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqNqF-0004x1-CS for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:40:35 -0400 References: <1460131992-32278-1-git-send-email-eblake@redhat.com> <1460131992-32278-6-git-send-email-eblake@redhat.com> <871t69ld38.fsf@dusky.pond.sub.org> <570E757B.5070909@redhat.com> From: Eric Blake Message-ID: <570E7681.80708@redhat.com> Date: Wed, 13 Apr 2016 10:40:33 -0600 MIME-Version: 1.0 In-Reply-To: <570E757B.5070909@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SBOR0OdmISue3GAOK8chUKfFkpTsfW3la" Subject: Re: [Qemu-devel] [PATCH v14 05/19] qmp-input: Clean up stack handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SBOR0OdmISue3GAOK8chUKfFkpTsfW3la Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/13/2016 10:36 AM, Eric Blake wrote: >> static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp) >> { >> assert(qiv->nb_stack > 0); >> >> if (qiv->strict) { >> GHashTable * const top_ht =3D qiv->stack[qiv->nb_stack - 1]= =2Eh; >> if (top_ht) { >> GHashTableIter iter; >> const char *key; >> >> g_hash_table_iter_init(&iter, top_ht); >> if (g_hash_table_iter_next(&iter, (void **)&key, NULL))= { >> error_setg(errp, QERR_QMP_EXTRA_MEMBER, key); >> >> This looks wrong. If we have more than one extra members, the second >> call error_setg() will fail an assertion in error_setv(), unless errp = is >> null. >=20 > Whoops - looks like f96493b1 is broken for missing a 'break' statement.= > I'll send that as a separate for-2.6 cleanup that we should pull soone= r > rather than later. Scratch that, there's no error. The outer statement is an 'if', not a 'for', so there's nothing to break out of. The error gets set at most once, regardless of whether there are additional unvisited members. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SBOR0OdmISue3GAOK8chUKfFkpTsfW3la Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXDnaBAAoJEKeha0olJ0NqxqQH/iI8HtOpHOGmlM3VLoTv8CRK Irrn9ah38fqv4Wx4UXG50AwwxSgETQWioNAGpVVOrqFAMQVXrbmCxHZFbp71qrxP 3tt42Bx+Zovv3WaACH67EgfwYwNJtUBcs2tqMM28WNm2SSoaFQ176I4zB4YM8zh+ VpkpOtLbDaTfP/cab7xbEIfUupAqMkOT31qP2mOGODRKmIqHSBkJjS+SvtEzcLgP CELH045/Pf3pPofCt0r2+PQkjujroqHigPK7aNS8i4BvWuOcqaBEfwBthFbNrBA8 fXe9ZoWO00EgsrtkbwNZykboDy7dA0VQ1EF0YcFLxWbfeGzPKk7tPy3URLTQIeU= =wIDE -----END PGP SIGNATURE----- --SBOR0OdmISue3GAOK8chUKfFkpTsfW3la--