This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a flag G_WANT, as a mask for the bits G_SCALAR, G_ARRAY and G_VOID.
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 11c316c..7dc6d14 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -2650,7 +2650,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
                goto redo_body;
            }
            PL_stack_sp = PL_stack_base + oldmark;
-           if (flags & G_ARRAY)
+           if ((flags & G_WANT) == G_ARRAY)
                retval = 0;
            else {
                retval = 1;
@@ -2749,7 +2749,7 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
            goto redo_body;
        }
        PL_stack_sp = PL_stack_base + oldmark;
-       if (flags & G_ARRAY)
+       if ((flags & G_WANT) == G_ARRAY)
            retval = 0;
        else {
            retval = 1;