From nobody Mon Feb 9 20:34:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579793271; cv=none; d=zohomail.com; s=zohoarc; b=AGCSnrkxDE1jUInYUhbvoH6kcpgZ7RufpPiE6DzwfmVTefAlLtIFweXIZbn+2ndh/vS6dyvuC9FRN5EvMQdA7rUu/0FkqfNVcebt7WXqTONJeuLCX3YaQafhTsbGcOJCcRdeQUr/4bTMFW5IPBZ5UbtXnHMA3oDURHzRVmJrcgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579793271; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ep2zLWRWUErqyW26G/7lhPUdGhrXWSwt7t7lct6ZAZY=; b=WCJQID8sejkjxVW7Q7QllWH2CKXkHLDR70R3HA2WNIEv30wWoEcZdVVvzFUNzIySz6dCgbAJfrDPmx9pVu+fULywGGeFmXgFwQ3X/d+bzEpjCxlXiiTv/Ckf8TJ+JS/NTiSeyH5BUGs5cTGtf7gruoCu5fkNFZDou8a6UIU6NNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579793271303647.9275347642882; Thu, 23 Jan 2020 07:27:51 -0800 (PST) Received: from localhost ([::1]:59314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueOb-0003bk-Kz for importer@patchew.org; Thu, 23 Jan 2020 10:27:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51610) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrY-0005Ei-Pe for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrX-0003pm-PI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:35779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrX-0003lj-Iy for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p17so2626280wmb.0 for ; Thu, 23 Jan 2020 05:49:35 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ep2zLWRWUErqyW26G/7lhPUdGhrXWSwt7t7lct6ZAZY=; b=sRy8iOPNqjb9Q0e2dDwtuRigFidACVrae3MelcvgkdCPP+ArYPOnJAlPxN21NoOPS0 4sct7Lr1t7i6GZe2+TVWQTIGbzCn75rWzZyh2b9T2YGp/WRPYmo3hyPy63NMu+kP5IGp SqKwMKwKiicnAonCavYGT+14n8nxy6AbPIzpoIF4N6qHSwa/emeigKZhnf8qdqmwc8I9 chyUg/GKnjtGgP/5l/Vb1dMBSDKeYrP1WJp/jA9onsw6dj3GtujQW7iWc2QyWkssmBAV 7qR1dUUa2pcVrUtQHm6E8bfIAobPZaYYrpHzq3yOJVby2HAahgCuFEs7XUfJxBx4rqYp YFIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ep2zLWRWUErqyW26G/7lhPUdGhrXWSwt7t7lct6ZAZY=; b=N9UXYUhbE40jQu9WvaPna8oJZOEik0wqcBFrFP//3ZdiyGi3UgTjnru/T3nX5m/XYI oTL+5fHPOy1IY5RDtd/AXcID/UzhFyQqCKFqKfJC3tB1lxnL1WGxLJmEgAC038XiERK7 9tIZH+TaVFZDcZiYCYHz+vWaVbREviiuULAgOcRk4bnhqmvZ3k9BVAa/McHLG3w+7LDD QwuUha9q+ziRBt6hBI4Pi6EDiYIoG+Dfm1xbP+cWTZYQSsMRwi3crJWYCIbP0JkRxQ+H Wx8a/b1PojwIm8S9guReJebUeVbkOSd/xGYlPXvcMVWR6WDF+37uqdUAG6lv3sLO1d4q MIRQ== X-Gm-Message-State: APjAAAWTX2dhwEWbyvbSZRBoMcm12vgp3LrUFXKjJm33uASMphA9YnN0 RbXj+KUjqK7NyfxXXhgBLhWD2C/6 X-Google-Smtp-Source: APXvYqyPtPwo4u5aktCz6eQ0F5hMEgXvZG5rGa+U9tUQtKJcRAcTxTBgGp82kgslX/PZCP7WeVXpgw== X-Received: by 2002:a05:600c:54c:: with SMTP id k12mr4320665wmc.124.1579787374395; Thu, 23 Jan 2020 05:49:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 31/59] object: add extra sanity checks Date: Thu, 23 Jan 2020 14:48:34 +0100 Message-Id: <1579787342-27146-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Type system checked that children class_size >=3D parent class_size, but not instances. Fix that. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200110153039.1379601-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index 90155fa..dcb6863 100644 --- a/qom/object.c +++ b/qom/object.c @@ -307,6 +307,7 @@ static void type_initialize(TypeImpl *ti) int i; =20 g_assert(parent->class_size <=3D ti->class_size); + g_assert(parent->instance_size <=3D ti->instance_size); memcpy(ti->class, parent->class, parent->class_size); ti->class->interfaces =3D NULL; ti->class->properties =3D g_hash_table_new_full( --=20 1.8.3.1