You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2016/04/22 21:45:33 UTC

thrift git commit: THRIFT-3795 Generated hashValue method in Swift will overflow Client: Swift Patch: Håkon Hitland

Repository: thrift
Updated Branches:
  refs/heads/master e0e3240d6 -> 80542987f


THRIFT-3795 Generated hashValue method in Swift will overflow
Client: Swift
Patch: Håkon Hitland


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/80542987
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/80542987
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/80542987

Branch: refs/heads/master
Commit: 80542987f96febd5182072b6ce32ffcc1d43eab7
Parents: e0e3240
Author: Jens Geyer <je...@apache.org>
Authored: Fri Apr 22 21:32:35 2016 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Apr 22 21:32:35 2016 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_swift_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/80542987/compiler/cpp/src/generate/t_swift_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_swift_generator.cc b/compiler/cpp/src/generate/t_swift_generator.cc
index 4b33993..a577c3d 100644
--- a/compiler/cpp/src/generate/t_swift_generator.cc
+++ b/compiler/cpp/src/generate/t_swift_generator.cc
@@ -562,7 +562,7 @@ void t_swift_generator::generate_swift_struct_hashable_extension(ofstream& out,
       t_field* tfield = *m_iter;
       string accessor = field_is_optional(tfield) ? "?." : ".";
       string defaultor = field_is_optional(tfield) ? " ?? 0" : "";
-      indent(out) << "result = prime * result + (" << tfield->get_name() << accessor <<  "hashValue" << defaultor << ")" << endl;
+      indent(out) << "result = prime &* result &+ (" << tfield->get_name() << accessor <<  "hashValue" << defaultor << ")" << endl;
     }
     
     indent(out) << "return result" << endl;