This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Minor bug fix in pp_require
authorVishal Bhatia <vishal@deja.com>
Sun, 20 Jun 1999 17:17:17 +0000 (10:17 -0700)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 7 Jul 1999 01:57:16 +0000 (01:57 +0000)
Message-ID: <AEBDBGKPMEAJAAAA@my-deja.com>

p4raw-id: //depot/perl@3630

ext/B/B/CC.pm

index eb67bcf..b909d44 100644 (file)
@@ -1105,6 +1105,7 @@ sub doeval {
     write_back_stack();
     my $sym = loadop($op);
     my $ppaddr = $op->ppaddr;
+    #runtime(qq/printf("$ppaddr type eval\n");/);
     runtime("PP_EVAL($ppaddr, ($sym)->op_next);");
     $know_op = 1;
     invalidate_lexicals(REGISTER|TEMPORARY);
@@ -1112,9 +1113,24 @@ sub doeval {
 }
 
 sub pp_entereval { doeval(@_) }
-sub pp_require { doeval(@_) }
 sub pp_dofile { doeval(@_) }
 
+#pp_require is protected by pp_entertry, so no protection for it.
+sub pp_require {
+    my $op = shift;
+    $curcop->write_back;
+    write_back_lexicals(REGISTER|TEMPORARY);
+    write_back_stack();
+    my $sym = doop($op);
+    runtime("while (PL_op != ($sym)->op_next && PL_op != (OP*)0 ){");
+    runtime("PL_op = (*PL_op->op_ppaddr)(ARGS);");
+    runtime("SPAGAIN;}");
+    $know_op = 1;
+    invalidate_lexicals(REGISTER|TEMPORARY);
+    return $op->next;
+}
+
+
 sub pp_entertry {
     my $op = shift;
     $curcop->write_back;