[
https://issues.apache.org/jira/browse/QPID-4730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13626071#comment-13626071
]
Hao Chang Yu commented on QPID-4730:
------------------------------------
This can be fixed in 'swig_perl_typemaps.i' file. Diff is provided below.
%typemap (out) uint16_t, uint32_t, uint64_t {
- sv_setuv($result, (UV)$1);
+ SV *tmp = sv_newmortal();
+ sv_setuv(tmp, (UV)$1);
+ $result = tmp;
argvi++;
}
@@ -197,7 +199,9 @@
}
%typemap (out) int32_t, int64_t {
- sv_setiv($result, (IV)$1);
+ SV *tmp = sv_newmortal();
+ sv_setiv(tmp, (IV)$1);
+ $result = tmp;
argvi++;
}
> Bug for qpid perl binding. The object is overwritten by the return value when
> a function return an integer.
> -----------------------------------------------------------------------------------------------------------
>
> Key: QPID-4730
> URL: https://issues.apache.org/jira/browse/QPID-4730
> Project: Qpid
> Issue Type: Bug
> Components: Perl Client
> Affects Versions: 0.18
> Reporter: Hao Chang Yu
> Fix For: 0.18
>
>
> As per subject. Please read the example below for more details.
> print("receiver: " . $receiver . "\n");
> print("getCapacity; " . $receiver->getCapacity() . "\n");
> print("receiver: " . $receiver . "\n");
> print("getAvailable: " . $receiver->getAvailable() . "\n");
> receiver: cqpid::Receiver=HASH(0xc0fbb8)
> getCapacity: 0
> receiver: 0
> 0: Operation now in progress: Can't call method "getAvailable" without a
> package or object reference at ./consumer.pl line 109.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]