Skip to content

Sequence IL copy operand translation#8319

Draft
plafosse wants to merge 1 commit into
devfrom
codex/fix-il-copy-operand-ordering
Draft

Sequence IL copy operand translation#8319
plafosse wants to merge 1 commit into
devfrom
codex/fix-il-copy-operand-ordering

Conversation

@plafosse

Copy link
Copy Markdown
Member

Summary

Evaluate multi-operand IL subexpressions into locals before constructing the copied expression.

Root cause

LowLevelILInstruction::CopyTo invoked a caller-provided subExprHandler multiple times as arguments to the same function call. C++ does not specify the order in which those arguments are evaluated. Stateful handlers, including the core LLIL-to-SSA translator's register-stack tracking callback, could therefore produce compiler-dependent output.

Impact

  • preserves left-to-right operand translation for binary and carry operations
  • preserves destination-before-source translation for stores and relative register-stack assignments
  • makes callback side effects deterministic across MSVC and Clang

Validation

  • compiled lowlevelilinstruction.cpp with the development build's C++20 flags using -fsyntax-only
  • git diff --check passes

Companion core changes are in Vector35/binaryninja#1666.

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