Repository navigation
Conversation
…o-struct ground truth A stripped binary keeps no struct names, so a pointer-to-struct variable could only match by an exact pointee name. Ground truth now carries a kind form (<struct>*, <union>**) for pointers to structs, classes and unions, and a decompiled pointer matches it at the same depth when its own output says the pointee is a struct or union: a struct/union keyword in the spelling or a declaration in decompiled_code. Primitive pointees keep the exact rule. tp_kind_only reports kind-only matches separately. Fixes #93 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cw8GgP4ynoKxZeBJ7RWZiN
This branch has not been deployed
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.
A stripped binary keeps no struct names, so a decompiler can recover "this argument points at a struct" but never
WORD *. type_match compares pointee names only, so a recoveredstruct_0 *scores the same miss aslong. With this change, a decompiled pointer to any struct matches a ground-truth pointer to a struct at the same depth. Primitive pointees (char *,void *,size_t *) still need the exact type, so typing every pointer as a struct pointer still loses thechar *match below:The fix:
<struct>*,<struct>**or<union>*. By-value structs, arrays and primitive pointees get none. A struct pointer never matches a union pointer.struct/unionkeyword in the spelling, or a struct/union declaration of the pointee name indecompiled_code(angr printstypedef struct struct_0 {...} struct_0;). A barestruct_0 *orFILE *with no declaration gets nothing. Native, legacy and text-only producers all use the same rule.tp_kind_onlyin function metadata counts kind-only matches, so recovering the real name still shows.cache_versiongoes from 17 to 18. If another type_match change lands first, this needs one more bump on rebase.Impact on coreutils O0 and O2, replayed from the published checkpoints. No function lost a TP.
struct stat *-style spellings that Improve C type parsing and attribution #106 also matches by name.The only conflict with #106 is the
cache_versionlines.Tests:
tests/test_type_match_struct_pointee.pybuilds gcc and g++ DWARF fixtures:const struct **, by-value,FILE *,char *,void *,size_t *, function pointer, and a C++ class and reference.struct_0 *, and a decompiler that types every pointer asstruct_0 *losing every primitive-pointer match.All six fail on main.
Fixes #93.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Cw8GgP4ynoKxZeBJ7RWZiN