# New Ticket Created by # Please include the string: [perl #134177] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=134177 > Here is test example which proves that when croak_on_error is set to 1 for eval_pv() function, it does not croak. Just compile it, run and see that die from eval_pv with croak_on_error=1 does not throw any error. $ xsubpp -prototypes -output test.c test.xs $ gcc test.c -I`perl -MConfig -e 'print $Config::Config{archlib}'`/CORE -fPIC -shared -o auto/test/test.so $ perl -I. -Mtest -e '' ERROR: eval_pv not died OK: eval_pv died with $@=string error at test.pm line 10. Source test code is below: $ cat test.pm package test; use XSLoader; BEGIN { XSLoader::load(__PACKAGE__) } use strict; use warnings; eval { eval_pv 'die bool_obj->new(0)'; 1 } and do { print "ERROR: eval_pv not died\n"; 1; } or do { print "OK: eval_pv died with \$@=$@" }; eval { eval_pv 'die bool_obj->new(1)'; 1 } and do { print "ERROR: eval_pv not died\n"; 1; } or do { print "OK: eval_pv died with \$@=$@" }; package bool_obj; use overload 'bool' => sub { ${$_[0]} }; use overload '""' => sub { "string error" }; sub new { bless \do{my $tmp = $_[1]}, $_[0] } 1; $ cat test.xs #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = test PACKAGE = test void eval_pv(string, croak_on_error = 1) const char *string I32 croak_on_error PPCODE: EXTEND(SP, 1); PUSHs(eval_pv(string, croak_on_error));Thread Previous