Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39663 invoked from network); 10 Nov 2015 11:30:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2015 11:30:03 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.177 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.177 mail-ig0-f177.google.com Received: from [209.85.213.177] ([209.85.213.177:37279] helo=mail-ig0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/72-21426-835D1465 for ; Tue, 10 Nov 2015 06:30:01 -0500 Received: by igbhv6 with SMTP id hv6so94492755igb.0 for ; Tue, 10 Nov 2015 03:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zend_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8nS1Xrc/HD2sPiBbbw6DGga1Dcxc/a5hrecNrqakWmE=; b=TF55+jH/QYIAgX7bOIWm1IcKcXrPI7HAXRDtgwXuNXu0L2Ceh0B41Cl1dBzLv7hGAB ViS3+jVqubZKcJHqNwD/u1TKizvirNDkB6/KU0UOQVe1l/bDRhcwtHMX/zpALo+hFXoP r4TdvHImI+II2i7F9HoPMxm8rF8O4JT3ZUtdDa65+yLId7deeS0yxP8qsOaYcKLzJrQY TOP4yGooFjflxgfz/r/KsmPsqgfYj114Fqq/VpUKKwVz/N1KOQscuHvIyyvR/bfnV6Pc RsTKf5jym5P5oSmKllVDZLRw7GZroNvyPAEYrj9nQiAM/vIGfS2ZenzZDR5GgxcsuTXi HNow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8nS1Xrc/HD2sPiBbbw6DGga1Dcxc/a5hrecNrqakWmE=; b=XHd+n9dHvog4ngTKcrtF1a0k+IoM6fX1b4xJC11bSWEcbnQ7pvYEhwC72VuMoJK3TJ Hzd33Zp/NW0CIMaxfo9lhb2N1xfJgjte55lvxAP2UCycxrMQ/sPb6jLimsNH7t9g8Uvi gzeb4SpwNiH4mfHCfxkcSbh2Exr1H1dPwXC3heDITDcCSBkm9WQJZUVAnLu7Oh8u9Ptt KgummK3UoKN0rz3U8K7z6vCzs7igzVg6ACHezU+Mi/K1ILGMd5mAWRI3TInXC3jhD28/ 0FepNugl4t6rvC93kSgNLs/LK31zPsRKUNtmOB5TPpU+5rtrTSwNeF4qhjJ9kzFVtWs4 ouvg== X-Gm-Message-State: ALoCoQmdImpJU7/+F5gIySe5QMmG5/VYfkYkO9KnW9BInKLsuOSCwvI1ETp9uPBAOiEP36ugwBNsL01Mf/1q9/8o3jsKQjHeNV7qmRDvlIrx4wbYz4X1lN2EAwDF6G6u3UcWxOa8ftaFuMQxNYD/tBG0cQ0PzseIVHvetd24buNuPQ9m/iSIoVQ= MIME-Version: 1.0 X-Received: by 10.50.65.101 with SMTP id w5mr26382565igs.3.1447154997798; Tue, 10 Nov 2015 03:29:57 -0800 (PST) Received: by 10.50.73.166 with HTTP; Tue, 10 Nov 2015 03:29:57 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Nov 2015 14:29:57 +0300 Message-ID: To: Nikita Popov Cc: Xinchen Hui , Bob Weinand , PHP Internals Content-Type: multipart/alternative; boundary=047d7b3a9c76944d0605242e0787 Subject: Re: Safe Temporary Cleanup on Exception (Variable Liveness) From: dmitry@zend.com (Dmitry Stogov) --047d7b3a9c76944d0605242e0787 Content-Type: text/plain; charset=UTF-8 On Tue, Nov 10, 2015 at 1:42 PM, Nikita Popov wrote: > On Tue, Nov 10, 2015 at 10:53 AM, Dmitry Stogov wrote: > >> Hi, >> >> Please take a look into >> https://gist.github.com/dstogov/43eaa3f3b68583877322 >> >> This is variation on Bob's idea about variable liveness. >> The patch is incomplete. Liveness construction is still naive. However, >> all tests are passed. >> >> Ranges are represented by start/end/variable cartages. (I suppose this >> representation is more compact, than in the original proposal). >> In general, it's possible to use few ranges for the same variable, if its >> whole live range is not linear. (this is not implemented yet). >> >> Related ideas and tests are welcome. >> >> Thanks. Dmitry. >> > > One leak this does not cover yet is a discarded delayed return value: > > function test() { > try { > $a = [1, 2, 3]; > return $a + []; > } finally { > throw new Exception; > } > } > > try { > test(); > } catch (Exception $e) {} > > This case is a bit tricky because it violates the usual invariant that all > temporaries have well-defined liveness ranges (either alive or not, no > maybe). We'd have to change that first. > I see the problem. We can't statically define live-ranges for finally code, because we don't know where it's going to be called from. May be we may reconstruct this at run-time. Thanks. Dmitry, > > Nikita > > --047d7b3a9c76944d0605242e0787--