Skip to content

Commit a96e831

Browse files
authored
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`.
1 parent bced89d commit a96e831

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/binaryen-c.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,15 @@ BINARYEN_API void BinaryenModuleDispose(BinaryenModuleRef module);
223223
// Literals. These are passed by value.
224224

225225
struct BinaryenLiteral {
226-
int32_t type;
226+
uintptr_t type;
227227
union {
228228
int32_t i32;
229229
int64_t i64;
230230
float f32;
231231
double f64;
232232
uint8_t v128[16];
233233
const char* func;
234+
// TODO: exn
234235
};
235236
};
236237

0 commit comments

Comments
 (0)