@@ -18,6 +18,7 @@ INLINE float
18
18
get_f32 (uint32_t offset )
19
19
{
20
20
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
21
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
21
22
22
23
return * (float * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
23
24
}
@@ -26,6 +27,7 @@ INLINE double
26
27
get_f64 (uint32_t offset )
27
28
{
28
29
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
30
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
29
31
30
32
return * (double * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
31
33
}
@@ -34,6 +36,7 @@ INLINE int8_t
34
36
get_i8 (uint32_t offset )
35
37
{
36
38
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
39
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
37
40
38
41
return * (int8_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
39
42
}
@@ -42,6 +45,7 @@ INLINE int16_t
42
45
get_i16 (uint32_t offset )
43
46
{
44
47
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
48
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
45
49
46
50
return * (int16_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
47
51
}
@@ -50,6 +54,7 @@ INLINE int32_t
50
54
get_i32 (uint32_t offset )
51
55
{
52
56
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
57
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
53
58
54
59
return * (int32_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
55
60
}
@@ -58,6 +63,7 @@ INLINE int64_t
58
63
get_i64 (uint32_t offset )
59
64
{
60
65
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
66
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
61
67
62
68
return * (int64_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ];
63
69
}
@@ -67,6 +73,7 @@ INLINE void
67
73
set_f32 (uint32_t offset , float value )
68
74
{
69
75
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
76
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
70
77
71
78
* (float * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
72
79
}
@@ -75,6 +82,7 @@ INLINE void
75
82
set_f64 (uint32_t offset , double value )
76
83
{
77
84
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
85
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
78
86
79
87
* (double * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
80
88
}
@@ -83,6 +91,7 @@ INLINE void
83
91
set_i8 (uint32_t offset , int8_t value )
84
92
{
85
93
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
94
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
86
95
87
96
* (int8_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
88
97
}
@@ -91,6 +100,7 @@ INLINE void
91
100
set_i16 (uint32_t offset , int16_t value )
92
101
{
93
102
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
103
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
94
104
95
105
* (int16_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
96
106
}
@@ -99,6 +109,7 @@ INLINE void
99
109
set_i32 (uint32_t offset , int32_t value )
100
110
{
101
111
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
112
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
102
113
103
114
* (int32_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
104
115
}
@@ -107,6 +118,7 @@ INLINE void
107
118
set_i64 (uint32_t offset , int64_t value )
108
119
{
109
120
assert (sledge_abi__current_wasm_module_instance .memory .buffer != NULL );
121
+ assert (offset < sledge_abi__current_wasm_module_instance .memory .size );
110
122
111
123
* (int64_t * )& sledge_abi__current_wasm_module_instance .memory .buffer [offset ] = value ;
112
124
}
0 commit comments