Skip to content

Fix v1 instrumentation breaking if-else chains - #3

Open
kingkingkingson wants to merge 1 commit into
vul337:mainfrom
kingkingkingson:fix/instrument-else-chain
Open

Fix v1 instrumentation breaking if-else chains#3
kingkingkingson wants to merge 1 commit into
vul337:mainfrom
kingkingkingson:fix/instrument-else-chain

Conversation

@kingkingkingson

@kingkingkingson kingkingkingson commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • Fix instrument_v1 inserting distance_instrument() before else / else if, which breaks the if-else chain and fails compilation with else without a previous if.
  • When the target line starts with else, insert the call inside the else block (after {) instead.

Test plan

  • Instrument a TCU whose loc points at an else if line (e.g. libming decompile.c CVE-2018-8962) and confirm the generated source compiles.
  • Confirm non-else target lines still get instrumentation inserted before the statement.
  • Build v1 binary via trigfuzz.driver --use-script --skip-fuzz on the swftocxx target.

Made with Cursor

Inserting distance_instrument() before an else/else-if clause produces an 'else without a previous if' compile error; place the call inside the else block instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
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