Reject word sizes struct cannot express - #364
Conversation
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.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Scope: 14 of the 183 p-code languages pypcode 4.0.1.dev0 exposes report a three-byte word — HCS-12, HCS12, HCS-12X, PIC-18, PIC-24E/F/H, dsPIC30F, dsPIC33C/E/F and the three extended AVR languages. All returned Caveats: |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/archinfo_364 |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Arch.struct_fmt()returned"Z"for a three-byte word, so every 24-bit p-code architecture — the PIC, HCS-12 and extended AVR languages among them — handed its callers a format string that raises "bad char in struct format" as soon as anything uses it.structhas integer format characters for one, two, four and eight bytes and no way to name a three-byte integer, so the size really is invalid and this function should say so rather than invent a character for it.The regression checks that
ArchPcode("HCS-12:BE:24:default").struct_fmt()raises, and that every sizestructcan express still round-trips throughcalcsize.angr/cle#721 is the other half of this. Validation: #364 (comment).