X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/d09f14bff00cc465825c16e4e810687132f34070..93cd6fca2453b14be3c49ba8708aa01b7dab5829:/toke.c?ds=sidebyside diff --git a/toke.c b/toke.c index 4cdfcea..f94c0d5 100644 --- a/toke.c +++ b/toke.c @@ -4499,6 +4499,7 @@ I32 Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen) { filter_t funcp; + I32 ret; SV *datasv = NULL; /* This API is bad. It should have been using unsigned int for maxlen. Not sure if we want to change the API, but if not we should sanity @@ -4581,7 +4582,11 @@ Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen) /* Call function. The function is expected to */ /* call "FILTER_READ(idx+1, buf_sv)" first. */ /* Return: <0:error, =0:eof, >0:not eof */ - return (*funcp)(aTHX_ idx, buf_sv, correct_length); + ENTER; + save_scalar(PL_errgv); + ret = (*funcp)(aTHX_ idx, buf_sv, correct_length); + LEAVE; + return ret; } STATIC char *