You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by chetmurthy <gi...@git.apache.org> on 2017/12/02 01:42:12 UTC

[GitHub] thrift pull request #1434: THRIFT-4399 fix plugin.thrift & assoc C++ code to...

GitHub user chetmurthy opened a pull request:

    https://github.com/apache/thrift/pull/1434

    THRIFT-4399 fix plugin.thrift & assoc C++ code to respect unions

    plugin.thrift defines t_const_value as a union.  But in plugin_output.cc
    and plugin.cc, the converters clearly either (a) SET NEITHER of
    identifier_val & enum_val, or (b) SET BOTH.  But these are two different
    fields in the union.  So clearly, the type t_const_value isn't being
    treated as a union.
    
    I think we need to fix Thrift's treatment of unions, but independently,
    the plugin should use Thrift's type system in a correct manner.  This is
    easy-to-fix, but since the current plugin relies on a bug, the fix will
    be a breaking change.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chetmurthy/thrift THRIFT-4399-plugin-t_const_value-union-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1434.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1434
    
----
commit 915549d9f6ac5bb14e3ef296bd551b90c06a2896
Author: Chet Murthy <ch...@gmail.com>
Date:   2017-12-02T01:34:24Z

    THRIFT-4399 fix plugin.thrift & assoc C++ code to respect unions
    
    plugin.thrift defines t_const_value as a union.  But in plugin_output.cc
    and plugin.cc, the converters clearly either (a) SET NEITHER of
    identifier_val & enum_val, or (b) SET BOTH.  But these are two different
    fields in the union.  So clearly, the type t_const_value isn't being
    treated as a union.
    
    I think we need to fix Thrift's treatment of unions, but independently,
    the plugin should use Thrift's type system in a correct manner.  This is
    easy-to-fix, but since the current plugin relies on a bug, the fix will
    be a breaking change.

----


---

[GitHub] thrift pull request #1434: THRIFT-4399 fix plugin.thrift & assoc C++ code to...

Posted by chetmurthy <gi...@git.apache.org>.
Github user chetmurthy closed the pull request at:

    https://github.com/apache/thrift/pull/1434


---