In void context, eval leaves garbage on the stack. Don't then
copy this back into the threads->param array!
p4raw-id: //depot/perl@31864
}
$| = 1;
- print("1..33\n"); ### Number of tests that will be run ###
+ print("1..34\n"); ### Number of tests that will be run ###
};
print("ok 1 - Loaded\n");
print 'ok';
EOI
+# [perl #45053] Memory corruption from eval return in void context
+fresh_perl_is(<<'EOI', 'ok', { }, 'void eval return');
+ use threads;
+ threads->create(sub { eval '1' });
+ $_->join() for threads->list;
+ print 'ok';
+EOI
+
# test CLONE_SKIP() functionality
if ($] >= 5.008007) {
my %c : shared;
SPAGAIN;
for (ii=len-1; ii >= 0; ii--) {
SV *sv = POPs;
- if (jmp_rc == 0) {
+ if (jmp_rc == 0 && (! (thread->gimme & G_VOID))) {
av_store(params, ii, SvREFCNT_inc(sv));
}
}