You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roger Meier (JIRA)" <ji...@apache.org> on 2015/10/11 00:53:05 UTC
[jira] [Resolved] (THRIFT-3378) c_glib service does not handle
negative Thrift byte values correctly
[ https://issues.apache.org/jira/browse/THRIFT-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roger Meier resolved THRIFT-3378.
---------------------------------
Resolution: Fixed
Assignee: Nobuaki Sukegawa
> c_glib service does not handle negative Thrift byte values correctly
> --------------------------------------------------------------------
>
> Key: THRIFT-3378
> URL: https://issues.apache.org/jira/browse/THRIFT-3378
> Project: Thrift
> Issue Type: Bug
> Components: C glib - Compiler
> Reporter: Nobuaki Sukegawa
> Assignee: Nobuaki Sukegawa
>
> There's a problematic type cast in generated c_glib service code that treat the sign bit of gint8 as normal bit (i.e. 128).
> The problem is illustrated as follows.
> {code}
> int i = 0;
> users_handler_func((*gint8)&i); // Suppose this function tries to set i to -100
> store_handler_result(i); // This stores 156, not -100
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)