fix exploreState type guard to accept numeric state#891
Conversation
state is numeric and forwarded to tracePcIndir, but the guard checked for string and always returned early, dropping the hint.
|
gentle ping |
|
@metsw24-max Can you explain in detail how you found this issue and what your setup is? |
|
How I found it Reading through the guidance helpers in Setup Nothing elaborate, this came from reading the source rather than a fuzzing run, since a silently dropped hint won't surface as a crash. To confirm, I mocked Happy to move the test if you'd rather it lived elsewhere. |
|
@metsw24-max Can you check if mocking all of these is strictly necessary? If not, please remove: |
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.