[subset] Don't double count visit lookups in closure_lookups

Each recursed lookup was getting counted once in closure_lookups() and then again in hb_closure_lookups_context_t::recurse.
This commit is contained in:
Garret Rieger 2021-12-10 14:10:04 -08:00 committed by Behdad Esfahbod
parent d67025705f
commit 77507a1d8d
1 changed files with 5 additions and 1 deletions

View File

@ -214,7 +214,11 @@ struct hb_closure_lookups_context_t :
return; return;
/* Return if new lookup was recursed to before. */ /* Return if new lookup was recursed to before. */
if (is_lookup_visited (lookup_index)) if (lookup_limit_exceeded ()
|| visited_lookups->in_error ()
|| visited_lookups->has (lookup_index))
// Don't increment lookup count here, that will be done in the call to closure_lookups()
// made by recurse_func.
return; return;
nesting_level_left--; nesting_level_left--;