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/03/25 01:29:32 UTC
thrift git commit: THRIFT-3751 Compiler allows field ids that are too
large for generated code Client: Compiler (General) Patch: Jens Geyer
Repository: thrift
Updated Branches:
refs/heads/master 1043d71c2 -> 06340a466
THRIFT-3751 Compiler allows field ids that are too large for generated code
Client: Compiler (General)
Patch: Jens Geyer
This closes #964
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/06340a46
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/06340a46
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/06340a46
Branch: refs/heads/master
Commit: 06340a4664cd05cb78064a4216736c8aa4f782a8
Parents: 1043d71
Author: Jens Geyer <je...@apache.org>
Authored: Fri Mar 25 01:34:03 2016 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Mar 25 02:28:24 2016 +0200
----------------------------------------------------------------------
compiler/cpp/src/thrifty.yy | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/06340a46/compiler/cpp/src/thrifty.yy
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index dee4cb9..292670d 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -913,11 +913,19 @@ FieldIdentifier:
$$.value = static_cast<int32_t>($1);
$$.auto_assigned = false;
}
+ if( (SHRT_MIN > $$.value) || ($$.value > SHRT_MAX)) {
+ pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n",
+ $$.value, SHRT_MIN, SHRT_MAX);
+ }
}
|
{
$$.value = y_field_val--;
$$.auto_assigned = true;
+ if( (SHRT_MIN > $$.value) || ($$.value > SHRT_MAX)) {
+ pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n",
+ $$.value, SHRT_MIN, SHRT_MAX);
+ }
}
FieldReference: