With the move of PERL_ASYNC_CHECK() out from the runloop to control ops,
infinite loops became truely infinite, as their optree has no control ops.
Hence add a PERL_ASYNC_CHECK() to pp_unstack to ensure signals will be
dispatched.
Bug noticed by Jerry Hedden.
t/op/reverse.t See if reverse operator works
t/op/runlevel.t See if die() works from perl_call_*()
t/op/setpgrpstack.t See if setpgrp works
+t/op/sigdispatch.t See if signals are always dispatched
t/op/sleep.t See if sleep works
t/op/smartmatch.t See if the ~~ operator works
t/op/sort.t See if sort works
{
dVAR;
I32 oldsave;
+ PERL_ASYNC_CHECK();
TAINT_NOT; /* Each statement is presumed innocent */
PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;
FREETMPS;
--- /dev/null
+#!perl -w
+
+# We assume that TestInit has been used.
+
+BEGIN {
+ require './test.pl';
+}
+
+use strict;
+
+plan tests => 4;
+
+watchdog(10);
+
+$SIG{ALRM} = sub {
+ die "Alarm!\n";
+};
+
+pass('before the first loop');
+
+alarm 2;
+
+eval {
+ 1 while 1;
+};
+
+is($@, "Alarm!\n", 'after the first loop');
+
+pass('before the second loop');
+
+alarm 2;
+
+eval {
+ while (1) {
+ }
+};
+
+is($@, "Alarm!\n", 'after the second loop');