Gankra / abi-cafe

Pair your compilers up at The ABI Cafe!
https://faultlore.com/abi-cafe/book/
217 stars 15 forks source link

get bytes of semantic values too? #64

Open Gankra opened 2 months ago

Gankra commented 2 months ago

In #57 and #62 we moved from treating bool and enums as primitives with bytes to semantic values that can only be checked with patterns/ifs. This is good in terms of the harness not making up garbage values for "expect" and clean clear output, but it would be nice if we got the bytes of them too since often an ABI corruption will write forbidden values that don't make sense.

Right now this is tricky to do because the harness believes each "value" (field) can only have one payload (bytes). This would result in enums and bools having two payloads: the semantic tag, and the raw bytes.

Gankra commented 2 months ago

Note that the original semantic values -- (tagged/untagged) union variants -- are not eligible for this. they are truly purely semantic.