diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 47709868c..94f14ec3d 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -2246,14 +2246,7 @@ struct ContextClosureLookupContext void *intersected_glyphs_cache; }; -struct ContextDependLookupContext -{ - ContextClosureFuncs funcs; - ContextFormat context_format; - const void *intersects_data; - void *intersects_cache; - void *intersected_glyphs_cache; -}; +typedef ContextClosureLookupContext ContextDependLookupContext; struct ContextCollectGlyphsLookupContext { @@ -2311,11 +2304,9 @@ static inline void context_depend_lookup (hb_depend_context_t *c, unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */ ContextDependLookupContext &lookup_context) { - // ContextDependLookupContext has the same layout as ContextClosureLookupContext - auto &closure_lookup_context = reinterpret_cast(lookup_context); if (!context_intersects (c->glyphs, inputCount, input, - closure_lookup_context)) + lookup_context)) return; /* Build preliminary_context (empty for ContextSubst - no backtrack/lookahead) */ @@ -2875,7 +2866,7 @@ struct ContextFormat1_4 if (unlikely (!cur_active_glyphs)) return; get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs); - struct ContextDependLookupContext lookup_context = { + ContextDependLookupContext lookup_context = { {intersects_glyph, intersected_glyph}, ContextFormat::SimpleContext, nullptr, @@ -3075,7 +3066,7 @@ struct ContextFormat2_5 hb_map_t cache; intersected_class_cache_t intersected_cache; - struct ContextDependLookupContext lookup_context = { + ContextDependLookupContext lookup_context = { {intersects_class, intersected_class_glyphs}, ContextFormat::ClassBasedContext, &class_def, @@ -3347,7 +3338,7 @@ struct ContextFormat3 get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs); const LookupRecord *lookupRecord = &StructAfter (coverageZ.as_array (glyphCount)); - struct ContextDependLookupContext lookup_context = { + ContextDependLookupContext lookup_context = { {intersects_coverage, intersected_coverage_glyphs}, ContextFormat::CoverageBasedContext, this, @@ -3541,14 +3532,7 @@ struct ChainContextClosureLookupContext void *intersected_glyphs_cache; }; -struct ChainContextDependLookupContext -{ - ContextClosureFuncs funcs; - ContextFormat context_format; - const void *intersects_data[3]; - void *intersects_cache[3]; - void *intersected_glyphs_cache; -}; +typedef ChainContextClosureLookupContext ChainContextDependLookupContext; struct ChainContextCollectGlyphsLookupContext { @@ -3632,13 +3616,11 @@ static inline void chain_context_depend_lookup (hb_depend_context_t *c, unsigned value, ChainContextDependLookupContext &lookup_context) { - // ChainContextDependLookupContext has the same layout as ChainContextClosureLookupContext - auto &closure_lookup_context = reinterpret_cast(lookup_context); if (!chain_context_intersects (c->glyphs, backtrackCount, backtrack, inputCount, input, lookaheadCount, lookahead, - closure_lookup_context)) + lookup_context)) return; /* Build context information - extract backtrack and lookahead glyphs */ @@ -4354,7 +4336,7 @@ struct ChainContextFormat1_4 if (unlikely (!cur_active_glyphs)) return; get_coverage ().intersect_set (*c->glyphs, *cur_active_glyphs); - struct ChainContextDependLookupContext lookup_context = { + ChainContextDependLookupContext lookup_context = { {intersects_glyph, intersected_glyph}, ContextFormat::SimpleContext, {nullptr, nullptr, nullptr}, @@ -4558,7 +4540,7 @@ struct ChainContextFormat2_5 hb_map_t caches[3] = {}; intersected_class_cache_t intersected_cache; - struct ChainContextDependLookupContext lookup_context = { + ChainContextDependLookupContext lookup_context = { {intersects_class, intersected_class_glyphs}, ContextFormat::ClassBasedContext, {&backtrack_class_def, @@ -4893,7 +4875,7 @@ struct ChainContextFormat3 const auto &lookahead = StructAfter (input); const auto &lookup = StructAfter (lookahead); - struct ChainContextDependLookupContext lookup_context = { + ChainContextDependLookupContext lookup_context = { {intersects_coverage, intersected_coverage_glyphs}, ContextFormat::CoverageBasedContext, {this, this, this}, diff --git a/test/fuzzing/meson.build b/test/fuzzing/meson.build index ef1b0c234..87ecb8383 100644 --- a/test/fuzzing/meson.build +++ b/test/fuzzing/meson.build @@ -121,12 +121,10 @@ glob_cmd = find_program('glob.py', required: true) fonts_glob = run_command(glob_cmd, meson.current_source_dir() / 'fonts', check:true).stdout().strip().split('\n') subset_fonts_glob = run_command(glob_cmd, meson.current_source_dir() / '..' / 'subset' / 'data' / 'fonts', check:true).stdout().strip().split('\n') graphs_glob = run_command(glob_cmd, meson.current_source_dir() / 'graphs', check:true).stdout().strip().split('\n') -# Use well-formed API test fonts for depend fuzzer (not malformed clusterfuzz fonts) -api_fonts_glob = run_command(glob_cmd, meson.current_source_dir() / '..' / 'api' / 'fonts', check:true).stdout().strip().split('\n') # Chunk the glob lists to avoid command line length limits, and for parallelization chunk_size = 64 -foreach glob_name : ['fonts_glob', 'subset_fonts_glob', 'graphs_glob', 'api_fonts_glob'] +foreach glob_name : ['fonts_glob', 'subset_fonts_glob', 'graphs_glob'] glob = get_variable(glob_name) chunks = [] chunk = [] @@ -229,7 +227,7 @@ endif if conf.get('HB_EXPERIMENTAL_API', 0) == 1 i = 0 - foreach chunk : api_fonts_glob_chunks + foreach chunk : subset_fonts_glob_chunks test('depend-closure-parity-chunk-@0@'.format(i), hb_depend_closure_parity_exe, args: ['-s', '42'] + chunk,