arbitrary icon indicating copy to clipboard operation
arbitrary copied to clipboard

Enum discriminants should be taken from the end of the input string, like lengths

Open fitzgen opened this issue 5 years ago • 1 comments
trafficstars

The same rationale for why we take lengths from the end of the input byte string applies to discriminants: depending on the discriminant chosen, it changes which subsequent arbitrary calls are made and how many bytes are needed. It generally seems best to have "control flow"-y choices that affect shape be taken from the end of the input string and "filler" data taken from the start.

To do this we'll need to expose our internal int_in_range that takes from the end. Not sure what to call it, or how to explain why there are two variants in the documentation well...

fitzgen avatar Mar 10 '20 16:03 fitzgen

We should do this for dataful enums, C-like enums should still just fetch a number from the cursor position.

Manishearth avatar Mar 10 '20 21:03 Manishearth