From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZish-0002Yp-1M for qemu-devel@nongnu.org; Tue, 07 May 2013 10:28:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZisf-0001AN-4k for qemu-devel@nongnu.org; Tue, 07 May 2013 10:28:38 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:55146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZii6-0005lP-Or for qemu-devel@nongnu.org; Tue, 07 May 2013 10:17:42 -0400 Received: by mail-we0-f169.google.com with SMTP id x54so570921wes.14 for ; Tue, 07 May 2013 07:17:42 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 7 May 2013 16:16:39 +0200 Message-Id: <1367936238-12196-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1367936238-12196-1-git-send-email-pbonzini@redhat.com> References: <1367936238-12196-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 01/40] memory: assert that PhysPageEntry's ptr does not overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, jan.kiszka@siemens.com, qemulist@gmail.com, stefanha@redhat.com, david@gibson.dropbear.id.au Signed-off-by: Paolo Bonzini --- exec.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 19725db..2e5b89a 100644 --- a/exec.c +++ b/exec.c @@ -719,6 +719,8 @@ static void destroy_all_mappings(AddressSpaceDispatch *d) static uint16_t phys_section_add(MemoryRegionSection *section) { + assert(phys_sections_nb < TARGET_PAGE_SIZE); + if (phys_sections_nb == phys_sections_nb_alloc) { phys_sections_nb_alloc = MAX(phys_sections_nb_alloc * 2, 16); phys_sections = g_renew(MemoryRegionSection, phys_sections, -- 1.7.1