mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-26 01:11:25 +01:00
[sanitize] Only check trailing edge of ranges
Assumptions... Speeds up Gulzar load_face_and_shape benchmark by 7%.
This commit is contained in:
1 parent
6a683ea6eb
commit
e4856cf809
1 file changed
+2
-4
+2
-4
@@ -268,8 +268,7 @@ struct hb_sanitize_context_t :
|
||||
unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = (uintptr_t) (p - this->start) <= this->length &&
|
||||
(unsigned int) (this->end - p) >= len &&
|
||||
bool ok = (intptr_t) (this->end - p) >= (intptr_t) len &&
|
||||
((this->max_ops -= len) > 0);
|
||||
|
||||
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
|
||||
@@ -288,8 +287,7 @@ struct hb_sanitize_context_t :
|
||||
unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = ((uintptr_t) (p - this->start) <= this->length &&
|
||||
(unsigned int) (this->end - p) >= len);
|
||||
bool ok = (intptr_t) (this->end - p) >= (intptr_t) len;
|
||||
|
||||
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
|
||||
"check_range_fast [%p..%p]"
|
||||
|
||||
Reference in new issue
Block a user