summaryrefslogtreecommitdiff
path: root/lib/d
diff options
context:
space:
mode:
authorJames E. King III <jking@apache.org>2019-02-14 16:46:38 -0500
committerGitHub <noreply@github.com>2019-02-14 16:46:38 -0500
commitdbc1f8def5018ce5d85d38b9875c6c6b6b424478 (patch)
tree0011127f2edd9221f973eb157438bbd11c0b74d2 /lib/d
parent3ca88065dfdb24c5bad6fbd1e3a7e01812628d3b (diff)
downloadthrift-dbc1f8def5018ce5d85d38b9875c6c6b6b424478.tar.gz
THRIFT-4024, THRIFT-4783: throw when skipping invalid type (#1742)
* THRIFT-4024: make c_glib throw on unsupported type when skipping * THRIFT-4783: throw on invalid skip (py) * THRIFT-4024: make cpp throw on unsupported type when skipping * THRIFT-4024: uniform skip behavior on unsupported type
Diffstat (limited to 'lib/d')
-rw-r--r--lib/d/src/thrift/protocol/base.d8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/d/src/thrift/protocol/base.d b/lib/d/src/thrift/protocol/base.d
index 70648b3c3..5b6d84514 100644
--- a/lib/d/src/thrift/protocol/base.d
+++ b/lib/d/src/thrift/protocol/base.d
@@ -260,7 +260,7 @@ protected:
* in generated code.
*/
void skip(Protocol)(Protocol prot, TType type) if (is(Protocol : TProtocol)) {
- final switch (type) {
+ switch (type) {
case TType.BOOL:
prot.readBool();
break;
@@ -324,9 +324,9 @@ void skip(Protocol)(Protocol prot, TType type) if (is(Protocol : TProtocol)) {
}
prot.readSetEnd();
break;
- case TType.STOP: goto case;
- case TType.VOID:
- assert(false, "Invalid field type passed.");
+
+ default:
+ throw new TProtocolException(TProtocolException.Type.INVALID_DATA);
}
}