Merge pull request #2411 from simoncozens/fix-fix-contextual-overflow

This commit is contained in:
Simon Cozens 2021-09-23 12:45:40 +01:00 committed by GitHub
commit 19ab25d4ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,14 +389,15 @@ class ChainContextualBuilder(LookupBuilder):
candidates[1] = [self.buildFormat1Subtable(ruleset, chaining)]
for i in [1, 2, 3]:
try:
self.getCompiledSize_(candidates[i])
except Exception as e:
log.warning(
"Contextual format %i at %s overflowed (%s)"
% (i, str(self.location), e)
)
candidates[i] = None
if candidates[i]:
try:
self.getCompiledSize_(candidates[i])
except Exception as e:
log.warning(
"Contextual format %i at %s overflowed (%s)"
% (i, str(self.location), e)
)
candidates[i] = None
candidates = [x for x in candidates if x is not None]
if not candidates: