Repository navigation
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS At head Of the 183 p-code languages in pypcode 4.0.1.dev0, 14 report a three-byte word. They are HCS-12, HCS12, HCS-12X, PIC-18, PIC-24E/F/H, dsPIC30F, dsPIC33C/E/F, and the three extended AVR languages. All of them returned The earlier branch state used head |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/archinfo_364 |
6faa1ee to
6e59dcf
Compare
6e59dcf to
02d70fa
Compare
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Before this change, Before archinfo masterAfter this change, After with this change |
struct_fmt() returned "Z" for a 3-byte word. That is not a struct format character, so every 24-bit architecture handed its callers a format string that raises "bad char in struct format" on use. struct has integer format characters for 1, 2, 4 and 8 bytes only and no way to describe a 3-byte integer, so report the size as invalid instead of inventing a character for it; such a word has to be assembled from bytes by the caller.
02d70fa to
a6e6c48
Compare
register_arch documents regexes as "str or SRE_Pattern", but the type check used re._pattern_type, which CPython removed in 3.7, so passing a compiled pattern raised AttributeError instead of registering the architecture. Use the public re.Pattern. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Deleting the two Commit The merge-base-relative scores are: session: sharpen |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
Arch.struct_fmt()returnsZfor a three-byte word. Python'sstructmodule does not defineZ, so callers raise when they use the result. This affects explicitstruct_fmt(size=3)calls. It also affects 14 of pypcode's 187 SLEIGH languages, including the PIC, dsPIC, HCS-12, and extended AVR families:The exception occurs in the caller's
structcall instead of in the architecture that created the format string.Root cause
archinfo/arch.pymaps size 3 to a character thatstructdoes not define:structdefines integer formats for 1, 2, 4, and 8 bytes. It has no integer format for 3 bytes. The existingelsebranch already rejects sizes 5, 6, 7, and 16. Size 3 was the only unsupported size that returned a format string.Fix
The change removes the
size == 3branch. A three-byte word now reaches the existingelsebranch:The error now names the unsupported size. The docstring now states this constraint. Callers that need a 24-bit word must assemble it from bytes because
struct_fmtcannot express it.Related change: angr/cle#721
Details: #364 (comment)
sync: angr/cle#721
session: sharpen