fix: LLIL OperationOperands undercounts (17 ops)#27
Merged
Conversation
The OperationOperands count table in Struct/BNLowLevelILInstruction.cs sized the per-instruction RawOperands[] array too small for 17 operations, so accessing the affected typed-accessor property threw IndexOutOfRangeException at runtime. The undercounts fell into groups: - SSA register/flag/stack ops omitted the version's second raw slot (ASSERT_SSA, FLAG_BIT_SSA, REG_SSA_PARTIAL, REG_STACK_ABS_SSA, REG_STACK_REL_SSA, SET_REG_SSA_PARTIAL, FORCE_VER_SSA, CALL_STACK_SSA) - Phi ops omitted the 2-slot dest SSA (FLAG_PHI, REG_PHI, REG_STACK_PHI) - Memory-version slots omitted (STORE_SSA destMem/srcMem, TAILCALL_SSA) - Two-slot operands (ASSERT sourceRegister+constraint, FLAG_BIT/FLAG_COND, INTRINSIC output-list+intrinsic+params) Counts verified 1:1 against lowlevelilinstruction.h/.cpp; an SSA register/flag/stack occupies two raw slots (value, version), and the phi source-list readers route through the native list API so the count need only cover the directly-indexed slots. No bogus accessors found.
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.
Problem
The
OperationOperandscount table inStruct/BNLowLevelILInstruction.cssizes each instruction'sRawOperands[]array. 17 entries undercounted their operands, so accessing the affected typed-accessor property threwIndexOutOfRangeExceptionat runtime.Root cause
Counts verified 1:1 against
lowlevelilinstruction.h/.cpp(s_instructionOperandUsage+ the per-opLowLevelILInstructionAccessorraw-index calls). Misses by group:An SSA register/flag/stack occupies two raw slots (value, version). The phi source-list readers route through the native list API rather than
RawOperands[], so the count need only cover the directly-indexed slots. No bogus accessors found (verified each C# index maps to a genuine C++ operand).Same systematic-miscount cluster as HLIL (PR #26); MLIL follows in a separate PR.
Changes
Struct/BNLowLevelILInstruction.cs: 17 count bumps, each with an operand-list comment.Verification
dotnet build -c Releaseclean.crash_audit_llil.py): NO OOB after the fix (was 17 OOB).MustGetExpressionsweep overcat.bndbLLIL, invokes each declared operand-accessor getter, asserts none throwsIndexOutOfRangeException.