Skip to content

Fix AssertionError crash in reorder_arguments for misresolved structs#2957

Open
kazzarahw wants to merge 2 commits intocrytic:masterfrom
kazzarahw:fix/reorder-arguments-assertion-crash
Open

Fix AssertionError crash in reorder_arguments for misresolved structs#2957
kazzarahw wants to merge 2 commits intocrytic:masterfrom
kazzarahw:fix/reorder-arguments-assertion-crash

Conversation

@kazzarahw
Copy link

Summary

  • Replace the strict assertion in reorder_arguments with a filter that skips mismatched decl_names entries and returns args unmodified when no entry matches.
  • Add a bounds check in convert_constant_types for the same scenario (IndexError on st.elems_ordered[idx]).

Root cause

reorder_arguments crashes with an AssertionError when decl_names contains entries whose length doesn't match the call argument count. This happens when Slither misresolves a struct to a same-named struct with a different number of fields (e.g. two structs named PlasmaVaultAddress in different files, one with 7 fields and one with 1).

Fixes #2217

@kazzarahw kazzarahw requested a review from smonicas as a code owner January 29, 2026 09:49
@CLAassistant
Copy link

CLAassistant commented Jan 29, 2026

CLA assistant check
All committers have signed the CLA.

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.

[Bug]: Failed to generate IR for function due to assertion failure in named argument reordering

2 participants