hhvm: avoid a GCC7 warning by adding positive int constraints
Summary:
GCC 7 compile fails with:
In member function 'void HPHP::ThriftBuffer::read(char*, int)',
inlined from 'void HPHP::ThriftBuffer::read(int8_t&)'
at hphp/runtime/base/thrift-buffer.h:129:11,
inlined from 'void HPHP::ThriftBuffer::skip(int8_t)'
at hphp/runtime/base/thrift-buffer.cpp:135:27:
hphp/runtime/base/thrift-buffer.cpp:94:19: error:
'void* memcpy(void*, const void*, size_t)':
specified size between
18446744071562067968 and
18446744073709551615
exceeds maximum object size
9223372036854775807 [-Werror=stringop-overflow=]
So for int8_t the compiler thinks that `int avail` at
hphp/runtime/base/thrift-buffer.cpp:83 may go negative.
There is no way that m_p can go beyond m_pEnd,
so use not_reached() to enforce only positive values for avail.
Reviewed By: markw65
Differential Revision:
D6372117
fbshipit-source-id:
0b16e0a4b2a98c036174643f7bb83a08a7ab507d