• David Mitchell's avatar
    revert perl_run() 0 -> 256 return mapping · 47fb2c2a
    David Mitchell authored
    RT #133220
    
    This commit partially reverts v5.27.6-180-g0301e89953.
    
    That commit changed the return values of perl_parse() and perl_run()
    so that an exit(0) wouldn't return 0 (which indicates a normal finish)
    and instead return 0x100, which a indicates non-normal return, but with
    a value which if used as an 8-bit process exit value on UNIX, has the
    modulo value of 0.
    
    However, it turns out that perl_run() (via S_run_body()) does a my_exit(0)
    rather than just running to completion. So it turns out that it's not
    possible to distinguish between perl code finishing normally, and perl
    code doing exit(0).
    
    This broke code which embedded perl and expected perl_run() to return 0
    on normal completion.
    
    It may be possible to fix this by getting S_run_body() to not call
    my_exit(0), but that's too unpredictable change while we're at -RC1.
    
    So just revert the new perl_run() 0x100 behaviour for now.
    
    Bug: https://rt.perl.org/Public/Bug/Display.html?id=133220
    Origin: upstream, https://perl5.git.perl.org/perl.git/commit/9f9606382c45ba5e9600dddf96abfe956762af99
    Patch-Name: fixes/perl-run-return-value.diff
    47fb2c2a