From: Gurusamy Sarathy Date: Wed, 7 Jan 1998 20:06:05 +0000 (-0500) Subject: print/printf/... over-eager mg_find for glob magic: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3049007d1d4cd7f779efe25ccbd65634c7e84bd1;p=p5sagit%2Fp5-mst-13.2.git print/printf/... over-eager mg_find for glob magic: Subject: [PATCH] fix inefficient checks for TIEHANDLE p4raw-id: //depot/perl@404 --- diff --git a/pp_hot.c b/pp_hot.c index 23c3a95..7c320b3 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -295,7 +295,7 @@ PP(pp_print) gv = (GV*)*++MARK; else gv = defoutgv; - if (SvMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { + if (SvRMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { if (MARK == ORIGMARK) { MEXTEND(SP, 1); ++MARK; @@ -983,7 +983,7 @@ do_readline(void) I32 gimme = GIMME_V; MAGIC *mg; - if (SvMAGICAL(last_in_gv) && (mg = mg_find((SV*)last_in_gv, 'q'))) { + if (SvRMAGICAL(last_in_gv) && (mg = mg_find((SV*)last_in_gv, 'q'))) { PUSHMARK(SP); XPUSHs(mg->mg_obj); PUTBACK; diff --git a/pp_sys.c b/pp_sys.c index 23c7569..26886d1 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -927,7 +927,7 @@ PP(pp_getc) if (!gv) gv = argvgv; - if (SvMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { + if (SvRMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { I32 gimme = GIMME_V; PUSHMARK(SP); XPUSHs(mg->mg_obj); @@ -1145,7 +1145,7 @@ PP(pp_prtf) else gv = defoutgv; - if (SvMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { + if (SvRMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { if (MARK == ORIGMARK) { MEXTEND(SP, 1); ++MARK; @@ -1255,7 +1255,7 @@ PP(pp_sysread) gv = (GV*)*++MARK; if ((op->op_type == OP_READ || op->op_type == OP_SYSREAD) && - SvMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) + SvRMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) { SV *sv;