diff options
author | Tony Cook <tony@develop-help.com> | 2012-12-20 09:10:01 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2012-12-20 09:31:31 +1100 |
commit | 9712754a3e851ea70c1032ffb5e577dc0fdeca7b (patch) | |
tree | 120728c71441fe043d7cbbbf6a7b86e5a2a2e01c | |
parent | 85b59111fe65fd8577540e06fa1067b29f0b7a1e (diff) | |
download | perl-9712754a3e851ea70c1032ffb5e577dc0fdeca7b.tar.gz |
when the output isn't RETVAL, update the SV instead of replacing it
Previously OUTPUT argument parameters would replace ST(n) instead of
updating it, this meant that the caller's supplied value would not be
updated.
This change means that OUTPUT T_BOOL arguments called RETVAL won't be
handled correctly, but since the OUTPUT didn't work previously for
*any* case, this is a net improvement.
-rw-r--r-- | ext/XS-Typemap/t/Typemap.t | 2 | ||||
-rw-r--r-- | lib/ExtUtils/typemap | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t index 91daa20865..0717801150 100644 --- a/ext/XS-Typemap/t/Typemap.t +++ b/ext/XS-Typemap/t/Typemap.t @@ -152,7 +152,6 @@ ok( ! T_BOOL(undef) ); { # these attempt to modify a read-only value - local $TODO = "attempts to modify a read-only value should crash"; ok( !eval { T_BOOL_2(52); 1 } ); ok( !eval { T_BOOL_2(0); 1 } ); ok( !eval { T_BOOL_2(''); 1 } ); @@ -160,7 +159,6 @@ ok( ! T_BOOL(undef) ); } { - local $TODO = "Output parameters for T_BOOL don't work"; my ($in, $out); $in = 1; T_BOOL_OUT($out, $in); diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap index 0fa14fbcff..874bc161a8 100644 --- a/lib/ExtUtils/typemap +++ b/lib/ExtUtils/typemap @@ -328,7 +328,7 @@ T_SYSRET T_ENUM sv_setiv($arg, (IV)$var); T_BOOL - $arg = boolSV($var); + ${"$var" eq "RETVAL" ? \"$arg = boolSV($var);" : \"sv_setsv($arg, boolSV($var));"} T_U_INT sv_setuv($arg, (UV)$var); T_SHORT |