diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-09-16 15:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 15:46:22 +0200 |
commit | a96e8310e1a58c0a43b2d0e2ff4f9db24dd9a18a (patch) | |
tree | e1c184b4e1320207cdb7b059d83cb232604b93ce | |
parent | bced89d2986bde990bf9bf52306e55772b02707e (diff) | |
download | binaryen-a96e8310e1a58c0a43b2d0e2ff4f9db24dd9a18a.tar.gz binaryen-a96e8310e1a58c0a43b2d0e2ff4f9db24dd9a18a.tar.bz2 binaryen-a96e8310e1a58c0a43b2d0e2ff4f9db24dd9a18a.zip |
Fix 64-bit UB in BinaryenLiteral (#3136)
The maximum storage size of type ids changed with the introduction of tuples, with their type id being the memory address of the canonicalized type vector. This change aligns the storage type of type ids in `BinaryenLiteral` with `Literal` by changing the type from `int32_t` to `uintptr_t`.
-rw-r--r-- | src/binaryen-c.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 1adc73b8e..fdef58410 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -223,7 +223,7 @@ BINARYEN_API void BinaryenModuleDispose(BinaryenModuleRef module); // Literals. These are passed by value. struct BinaryenLiteral { - int32_t type; + uintptr_t type; union { int32_t i32; int64_t i64; @@ -231,6 +231,7 @@ struct BinaryenLiteral { double f64; uint8_t v128[16]; const char* func; + // TODO: exn }; }; |