summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-03-08 12:56:59 +0000
committerArne Juul <arnej@verizonmedia.com>2021-03-08 12:56:59 +0000
commitf1623b5c93bc7061fe54ddcf6daff69580354395 (patch)
tree8d01a26b8bc288c3fb66ad54ef92f3f5cc4e4ca3
parent023dacfb24664587a400a5b14ccc2d95287666c7 (diff)
do not assert when receiving invalid data (from network)
-rw-r--r--eval/src/vespa/eval/eval/value_codec.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/eval/src/vespa/eval/eval/value_codec.cpp b/eval/src/vespa/eval/eval/value_codec.cpp
index 500968347c6..98dc16aff66 100644
--- a/eval/src/vespa/eval/eval/value_codec.cpp
+++ b/eval/src/vespa/eval/eval/value_codec.cpp
@@ -117,8 +117,10 @@ ValueType decode_type(nbostream &input, const Format &format) {
dim_list.emplace_back(name, input.getInt1_4Bytes());
}
}
- if (dim_list.empty()) {
- assert(cell_type == CellType::DOUBLE);
+ if (dim_list.empty() && (cell_type != CellType::DOUBLE)) {
+ throw IllegalArgumentException(fmt("Scalar values must have cell type DOUBLE (was %u)",
+ (uint32_t)cell_type));
+
}
return ValueType::make_type(cell_type, std::move(dim_list));
}