From nobody Mon Feb 9 17:58:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=datto.com ARC-Seal: i=1; a=rsa-sha256; t=1562621596; cv=none; d=zoho.com; s=zohoarc; b=RwxRh/y5gYVtalZxBjiN3Qh9NK+WIrzHpFT73y6ONbicMJ7vadDKUiCfQMI32/mP1FZ8CdmoD151fd0fvSva3sJkE2Bfqud6laAVBdDVPjSFaQow6wEcUQoZR0pN+isxlGYltf8NPQI+IPksMSjYCARi8R4e/oF1qbusZ48C7zM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562621596; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=jZHWAXMEE+nb7IXfbFFRRQVgBVy2ucaqq5Hf0Wp2F1A=; b=Rkl2T/LaxLVwJObvtite7BcXB8M+9c4F621Xc1xBLx6lhaYqVQUWJDn+/MWWbNklsonCMZruvTJADNohpK9tRuOnsjBK6rgyohQqHQbrTwLo8Cyms6xiIu/r3rLXI/komihWCUtCWwAJa+6Kjp8wgoXn06jb/f8mw7z23lkW+FE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562621596725910.5999473901586; Mon, 8 Jul 2019 14:33:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87050308621B; Mon, 8 Jul 2019 21:33:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 554365D9C8; Mon, 8 Jul 2019 21:33:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC5708E1F; Mon, 8 Jul 2019 21:32:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x68LWneO015220 for ; Mon, 8 Jul 2019 17:32:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id BE297111F3C2; Mon, 8 Jul 2019 21:32:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.rdu2.redhat.com [10.11.55.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B903C111F3B6 for ; Mon, 8 Jul 2019 21:32:47 +0000 (UTC) Received: from us-smtp-delivery-195.mimecast.com (us-smtp-delivery-195.mimecast.com [216.205.24.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D47877D89 for ; Mon, 8 Jul 2019 21:32:47 +0000 (UTC) Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-xIZUTJggPTOTSIenF0plzQ-1; Mon, 08 Jul 2019 17:32:15 -0400 Received: by mail-qt1-f200.google.com with SMTP id i12so14863678qtq.4 for ; Mon, 08 Jul 2019 14:32:15 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id j184sm7836012qkc.65.2019.07.08.14.32.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 14:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto.com; s=mimecast20190208; t=1562621567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E3THaBmGG6LKjzHR2taGWxhtQ1djEyB/h+HfyJmrOog=; b=X5JTSLll6RdzZ/zFVRPKBr8A+o5jvnTkJcgMazd55QDt1Recx/DWYbnZL2ilzXjRrtCaID Ht5N8Kv40yS3HnYbkyFpFaVuudUpSdBCIpIKsbDelM2Qn8NKHTgdh3B5KiDDQ1KeCfXRh8 5U8MNYkkpm3iOgFnv8/B947mBXDZB44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VQX0uMV0mk7mZ9A0qFrC7+I6lEf9SP98/MeohAEYjSg=; b=CV/yUSSKlCLTAdBpTW6B0dT1kaVsHUE9HLuv/EZJvmp9b4AhOENQiNoWhQtkXE90VX Z8Pdxj3MGa+GYRcEWyoWTU42FAxlsxnXoSO3ri2a8sqZXmF2Bq2zOA9MwqI9gGwv4rEy IfktpKKWCMIwv/mgMqZN/jlRQYAyzjDtzwARMsh5FqYS62rUNs8lll9fbrUK2I28A3Dj xJnO++h4lJF5/AA5WTFnze3bqdFdRsejO0u1Qt7MpjGPCVdpim8SgmzVy0Aj+7xhgbyy XUObDwDOmK/UI1N9iqjs4oQanbhFrTK7CpT0b5vfoiLPERLmyH5u9fmvhPtPaJz6wL8F w8pQ== X-Gm-Message-State: APjAAAX46tTdKjDvbdYyjfe9eJ7gv1vvRFAD09w4F1mFllBlwEyXGdwN hQZgG6FBtcOXreLP4SYJ0XhkSz5QABB85MB8hdByXUgbTCmDfmL5YqmfJxbOId80x9pDcLC3xUm 8w81ArJo94E63nbWZ X-Received: by 2002:ac8:4413:: with SMTP id j19mr15599448qtn.281.1562621534737; Mon, 08 Jul 2019 14:32:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxxSruuktoMweAdgF4n37ZXN1nhYOL2xxDKEfQm1L0PqQlRYb3KnDx+JevF+OY7D2jdmdK3A== X-Received: by 2002:ac8:4413:: with SMTP id j19mr15599435qtn.281.1562621534559; Mon, 08 Jul 2019 14:32:14 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 17:32:11 -0400 Message-Id: <20190708213212.9002-2-dzamirski@datto.com> In-Reply-To: <20190708213212.9002-1-dzamirski@datto.com> References: <20190708213212.9002-1-dzamirski@datto.com> MIME-Version: 1.0 X-MC-Unique: xIZUTJggPTOTSIenF0plzQ-1 X-Mimecast-Spam-Score: 0 X-Greylist: Sender passed SPF test, ACL 243 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 08 Jul 2019 21:32:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 08 Jul 2019 21:32:47 +0000 (UTC) for IP:'216.205.24.195' DOMAIN:'us-smtp-delivery-195.mimecast.com' HELO:'us-smtp-delivery-195.mimecast.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: -0.8 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 216.205.24.195 us-smtp-delivery-195.mimecast.com 216.205.24.195 us-smtp-delivery-195.mimecast.com X-Scanned-By: MIMEDefang 2.78 on 10.11.55.2 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x68LWneO015220 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-php PATCH 1/2] Fix PHP7 VIRT_ARRAY_INIT macro implementation. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 08 Jul 2019 21:33:13 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is a PHP 7 compatibilty macro which was segfaulting due to the temporary variable being defined in the do..while scoped block (to swallow semicolon for macros), e.g: zval *arr; VIRT_ARRAY_INIT(arr); VIRT_ADD_ASSOC_STRING(arr, "foo", "bar"); // <=3D segfault here The VIRT_ARRAY_INIT above was expanding to: do { zval z_arr; // <=3D local scope definition arr =3D &z_arr; array_init(arr); } while (0) After this patch, the macro expands to: zval z_arr; // now defined in the scope of the macro caller do { arr =3D &z_arr; array_init(arr); } while (0) which solved the issue. --- src/util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util.h b/src/util.h index 3af77d4..c96fd0c 100644 --- a/src/util.h +++ b/src/util.h @@ -151,10 +151,11 @@ } \ } while(0) =20 -# define VIRT_ARRAY_INIT(_name) do { \ +# define VIRT_ARRAY_INIT(_name) \ zval z##_name; \ - _name =3D &z##_name; \ - array_init(_name); \ + do { \ + _name =3D &z##_name; \ + array_init(_name); \ } while(0) =20 # else /* PHP_MAJOR_VERSION < 7 */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list