mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 23:41:03 +01:00
[sanitize] Reorder condition to silence bogus gcc warning
Was givin a dozen of:
../../src/hb-machinery.hh: In member function ‘bool AAT::ankr::sanitize(hb_sanitize_context_t*) const’:
../../src/hb-machinery.hh:307:23: warning: missed loop optimization, the loop counter may overflow [-Wunsafe-loop-optimizations]
bool ok = --this->max_ops > 0 &&
~~~~~~~~~~~~~~~~~~~~~~
this->start <= p &&
~~~~~~~~~~~~~~~~~~~
p <= this->end &&
~~~~~~~~~~~~~~~^~
(unsigned int) (this->end - p) >= len;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I believe those are bogus, but this silences them and does not introduce
logic issues I believe.
This commit is contained in:
1 parent
1a6b5ac6c3
commit
e9f9c0d81c
1 file changed
+3
-3
+3
-3
@@ -302,10 +302,10 @@ struct hb_sanitize_context_t :
|
||||
inline bool check_range (const void *base, unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = this->max_ops-- > 0 &&
|
||||
this->start <= p &&
|
||||
bool ok = this->start <= p &&
|
||||
p <= this->end &&
|
||||
(unsigned int) (this->end - p) >= len;
|
||||
(unsigned int) (this->end - p) >= len &&
|
||||
this->max_ops-- > 0;
|
||||
|
||||
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
|
||||
"check_range [%p..%p] (%d bytes) in [%p..%p] -> %s",
|
||||
|
||||
Reference in new issue
Block a user