Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89146 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35254 invoked from network); 10 Nov 2015 10:42:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2015 10:42:19 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:34976] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/F1-21426-A0AC1465 for ; Tue, 10 Nov 2015 05:42:18 -0500 Received: by wmdw130 with SMTP id w130so64823754wmd.0 for ; Tue, 10 Nov 2015 02:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PsfAHhAlHubMotW7fPGSNTTl0UUeQp3frJlg5i+AzTw=; b=UPMXeGyf2qWetQnfNbXGV5ZRK5CD9sNPa3z4hEI+PvSmHxe5R83asALZEFKMMI21us HWv/UCJYXE8PqQMN4YOQKRc/9LqcGKhgFbnUjqHMxVZqNhNAjpfqUn7t/4FdtNA/H95j UXeHpDrbehiy/ygiRXUnBZjFJkf3opJEQQhfeqZCUA3uSTbjrD5e07EhoN6b9pjF7Tmc fzVXR3K7dLK2QGWt+5Vmb5/UN0ccLdnID4HQJzkMuYh9++NjNpKHcGNpdKvBBCnWGgSs gVZnhwhFwQsDGwEeohRtZGKrcETN2MqeZOm+o2G5JO8bRhG7xBEwCHMJhqwt2GJIncAZ ialw== MIME-Version: 1.0 X-Received: by 10.194.84.42 with SMTP id v10mr3221913wjy.116.1447152135436; Tue, 10 Nov 2015 02:42:15 -0800 (PST) Received: by 10.27.84.70 with HTTP; Tue, 10 Nov 2015 02:42:15 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Nov 2015 11:42:15 +0100 Message-ID: To: Dmitry Stogov Cc: Xinchen Hui , Bob Weinand , PHP Internals Content-Type: multipart/alternative; boundary=047d7beba1daf803da05242d5c43 Subject: Re: Safe Temporary Cleanup on Exception (Variable Liveness) From: nikita.ppv@gmail.com (Nikita Popov) --047d7beba1daf803da05242d5c43 Content-Type: text/plain; charset=UTF-8 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. Nikita --047d7beba1daf803da05242d5c43--