Skip to content

fix exploreState type guard to accept numeric state#891

Open
metsw24-max wants to merge 1 commit into
CodeIntelligenceTesting:mainfrom
metsw24-max:explorestate-number-guard
Open

fix exploreState type guard to accept numeric state#891
metsw24-max wants to merge 1 commit into
CodeIntelligenceTesting:mainfrom
metsw24-max:explorestate-number-guard

Conversation

@metsw24-max
Copy link
Copy Markdown

exploreState guards its input with typeof state !== "string", but state is the numeric value forwarded to tracePcIndir and on to the native __sanitizer_cov_trace_pc_indir_with_pc hook. Every documented call passes a number, so the guard always returns early and the hint is silently dropped, while a stray string would reach the native handler unchecked. Switch the check to typeof state !== "number", matching the signature and the string guards in guideTowardsEquality and guideTowardsContainment. Includes a regression test.

state is numeric and forwarded to tracePcIndir, but the guard checked for string and always returned early, dropping the hint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant