Permalink
Browse files

Enable specifing list context to p5 subs (we still support only one r…

…eturn value).
  • Loading branch information...
1 parent 83e8bea commit 0ae0fa0e23ec1e6b6edbba65093a33d65b5966ec @pmurias pmurias committed Jan 16, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −2 lib/p5embed.c
  2. +1 −0 t/spectest_p5.data
View
@@ -90,9 +90,9 @@ SV* p5embed_subcall(int context,SV** args,int args_count) {
/* HACK - list context is NYI */
if (context == 1 || context == 0) {
- int count = call_sv(args[0],G_SCALAR);
+ int count = call_sv(args[0],context == 1 ? G_SCALAR : G_ARRAY);
SPAGAIN;
- if (count != 1) croak("Big trouble\n");
+ if (count != 1) croak("We do not support returning multiple return values yet.\n");
SV* ret = POPs;
View
@@ -1,2 +1,3 @@
S01-perl-5-integration/subs.t
S01-perl-5-integration/strings.t
+S01-perl-5-integration/context.t

0 comments on commit 0ae0fa0

Please sign in to comment.