Repository navigation
Fix Converter::GetConversionChain() returning nullptr when normalization is configured - #1380
Merged
Merged
Conversation
…ion is configured Introduce ConfigBasedConverter to correctly expose the main conversion chain when a normalization pre-pass is present, resolving a null-pointer crash in downstream consumers such as librime. Also bumps the CMake/Bazel fallback version to 1.4.0 and tightens the installed public header set. Note: dev builds derived from untagged commits may still report package version 1.3.2.dev…; the SOVERSION is explicitly pinned to 1.4 by the preceding commit (BYVoid#1377) and is unaffected by the git-tag-derived package version. Detailed Changes: - **ConfigBasedConverter** (new private class): - Wraps normConverter + mainConverter; delegates GetConversionChain() to mainConverter so callers always receive a valid non-null ConversionChain. - Replaces PipelineConverter in Config.cpp when a normalization field is present. - **Public header cleanup**: - DictConverter.hpp, PhraseExtract.hpp, UTF8StringSlice.hpp moved from LIBOPENCC_HEADERS to LIBOPENCC_PRIVATE_HEADERS (CLI-tool internals, not library API). - BinaryDict.hpp, DartsDict.hpp likewise moved to private (were incorrectly appended to the public list). - **Version fallback**: cmake/GitVersion.cmake minor 3→4, revision 2→0; MODULE.bazel version 1.3.2→1.4.0. - **Regression test**: NormalizationGetConversionChainIsNonNull verifies GetConversionChain() is non-null and delegates to the main chain, not the normalization chain.
Collaborator
Author
|
cc @loafer-19 @lotem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce
ConfigBasedConverterto correctly expose the main conversion chain when a normalization pre-pass is present, resolving a null-pointer crash in downstream consumers such as librime. Also bumps the CMake/Bazel fallback version to 1.4.0 and tightens the installed public header set.NOTE: dev builds derived from untagged commits may still report package version 1.3.2.dev…; the SOVERSION is explicitly pinned to 1.4 by the preceding commit (#1377) and is unaffected by the git-tag-derived package version.
Detailed Changes:
normConverter+mainConverter; delegatesGetConversionChain()tomainConverterso callers always receive a valid non-nullConversionChain.PipelineConverterinConfig.cppwhen a normalization field is present.DictConverter.hpp,PhraseExtract.hpp,UTF8StringSlice.hppmoved fromLIBOPENCC_HEADERStoLIBOPENCC_PRIVATE_HEADERS(CLI-tool internals, not library API).BinaryDict.hpp,DartsDict.hpplikewise moved to private (were incorrectly appended to the public list).