Initialize sentinel rule hash in SectionMap constructor - #1759
Open
Bhoumik Patidar (BhoumikPatidar) wants to merge 1 commit into
Open
Initialize sentinel rule hash in SectionMap constructor#1759Bhoumik Patidar (BhoumikPatidar) wants to merge 1 commit into
Bhoumik Patidar (BhoumikPatidar) wants to merge 1 commit into
Conversation
Bhoumik Patidar (BhoumikPatidar)
requested a review
from quic-areg
as a code owner
August 24, 2026 13:54
Bhoumik Patidar (BhoumikPatidar)
force-pushed
the
fix/sectionmap-sentinel-rule-hash
branch
from
August 24, 2026 13:56
1ac0fe0 to
048ae27
Compare
Parth (parth-07)
requested changes
Aug 24, 2026
Parth (parth-07)
left a comment
Contributor
There was a problem hiding this comment.
Please add tests for this fix.
Bhoumik Patidar (BhoumikPatidar)
force-pushed
the
fix/sectionmap-sentinel-rule-hash
branch
from
August 24, 2026 14:35
048ae27 to
731b552
Compare
The SectionMap constructor creates an OutputSectionEntry with an empty name
and pattern via insert("",""). This entry's RuleContainer's RuleHash field is
never set and remains std::nullopt. Calling RuleContainer::getRuleHash() and
dereferencing the result leads to an assertion failure.
Fix: After insert("",""), call setRuleHash on the returned RuleContainer with
llvm::hash_combine("","",0) as this is an empty RuleText. This ensures
every RuleContainer in the SectionMap has a valid hash.
Resolves qualcomm#1758
Signed-off-by: Bhoumik Patidar <bpatidar@qti.qualcomm.com>
Bhoumik Patidar (BhoumikPatidar)
force-pushed
the
fix/sectionmap-sentinel-rule-hash
branch
from
August 25, 2026 19:53
731b552 to
b887dee
Compare
Shankar Easwaran (quic-seaswara)
approved these changes
Aug 26, 2026
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.
The
SectionMapconstructor creates anOutputSectionEntrywith an empty name and pattern viainsert("",""). This entry'sRuleContainer'sRuleHashfield is never set and remainsstd::nullopt. CallingRuleContainer::getRuleHash()and dereferencing the result leads to an assertion failure.Fix: After
insert("",""), callsetRuleHashon the returnedRuleContainerwithllvm::hash_combine("","",0)as this is an emptyRuleText. This ensures everyRuleContainerin theSectionMaphas a valid hash.Resolves #1758