diff options
author | Alon Zakai <azakai@google.com> | 2024-04-11 13:33:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 13:33:05 -0700 |
commit | 729f64c4212c338a9e7324cc55414ecc62a78893 (patch) | |
tree | 90029379ca0d08d5f3624389c4c0b17dbff58346 /src/ir/possible-contents.h | |
parent | 0b0c338bdd66227919d1de474e5eaae0d92e03e4 (diff) | |
download | binaryen-729f64c4212c338a9e7324cc55414ecc62a78893.tar.gz binaryen-729f64c4212c338a9e7324cc55414ecc62a78893.tar.bz2 binaryen-729f64c4212c338a9e7324cc55414ecc62a78893.zip |
GUFA: Fix signed reads of packed GC data (#6494)
GUFA already truncated packed fields on write, which is enough for unsigned gets,
but for signed gets we also need to sign them on reads.
Similar to #6493 but for GUFA. Also found by #6486
Diffstat (limited to 'src/ir/possible-contents.h')
-rw-r--r-- | src/ir/possible-contents.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ir/possible-contents.h b/src/ir/possible-contents.h index 7ff0f1a07..5ec4f758f 100644 --- a/src/ir/possible-contents.h +++ b/src/ir/possible-contents.h @@ -446,6 +446,11 @@ struct SignatureResultLocation { // The location of contents in a struct or array (i.e., things that can fit in a // dataref). Note that this is specific to this type - it does not include data // about subtypes or supertypes. +// +// We store the truncated bits here when the field is packed. That is, if -1 is +// written to an i8 then the value here will be 0xff. StructGet/ArrayGet +// operations that read a signed value must then perform a sign-extend +// operation. struct DataLocation { HeapType type; // The index of the field in a struct, or 0 for an array (where we do not |