From 02d9ab0a6212617fec466f93302573144e41c33a Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 4 Jan 2011 10:13:42 +0000 Subject: [PATCH] Remove a long-vestigial PUTBACK from the tied OPEN code in pp_send. Commit 4592e6caefc41a75, from 1999, added the PUTBACK as part of the initial implementation of tied OPEN. At this time, pp_open (as then was) popped the arguments off the stack (to local variables), so the new tie code pushed them back onto the stack, before calling the method. The stack position was manipulated, hence the local variable sp had potentially diverged from the global PL_stack_sp, hence the latter needed updating. Commit a567e93b903bc984, from 2001, which added support for open $fh, '|-', @array; refactored pp_open to avoid all stack manipulation. Hence sp (the local variable) never changes along this code path, hence it never needs to be written back to PL_stack_sp. --- pp_sys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/pp_sys.c b/pp_sys.c index cf6263a..5eb7000 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -538,7 +538,6 @@ PP(pp_open) /* ... except handle is replaced by the object */ PUSHMARK(MARK - 1); *MARK = SvTIED_obj(MUTABLE_SV(io), mg); - PUTBACK; ENTER_with_name("call_OPEN"); call_method("OPEN", G_SCALAR); LEAVE_with_name("call_OPEN"); -- 2.7.4