Merge remote-tracking branch 'origin/topic/bbannier/fix-signed-unsigned-comparison'

This commit is contained in:
Benjamin Bannier 2023-10-12 17:11:18 +02:00
commit e121654ee7
3 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,11 @@
6.1.0-dev.553 | 2023-10-12 17:11:18 +0200
* Fix signed-unsigned comparison. (Benjamin Bannier, Corelight)
We compared the return value of `sizeof` which returns a `std::size_t`
with an `int` which GCC warned about. This patch changes the `int` to a
`size_t`.
6.1.0-dev.551 | 2023-10-12 15:53:45 +0200 6.1.0-dev.551 | 2023-10-12 15:53:45 +0200
* quic: Avoid bytes for VariableLengthInteger (Arne Welzel, Corelight) * quic: Avoid bytes for VariableLengthInteger (Arne Welzel, Corelight)

View file

@ -1 +1 @@
6.1.0-dev.551 6.1.0-dev.553

View file

@ -851,7 +851,7 @@ inline ValPtr to_val(const hilti::rt::Bitfield<Ts...>& v, TypePtr target) {
throw TypeMismatch("bitfield", target); throw TypeMismatch("bitfield", target);
auto rval = make_intrusive<RecordVal>(rtype); auto rval = make_intrusive<RecordVal>(rtype);
int idx = 0; size_t idx = 0;
hilti::rt::tuple_for_each(v.value, [&](const auto& x) { hilti::rt::tuple_for_each(v.value, [&](const auto& x) {
if ( idx < sizeof...(Ts) - 1 ) // last element is original integer value, with no record equivalent if ( idx < sizeof...(Ts) - 1 ) // last element is original integer value, with no record equivalent
set_record_field(rval.get(), rtype, idx++, x); set_record_field(rval.get(), rtype, idx++, x);