Skip to content

Commit f27a974

Browse files
committed
Update Wasm3
1 parent a2499c4 commit f27a974

File tree

12 files changed

+14
-17
lines changed

12 files changed

+14
-17
lines changed

examples/Wasm_Blink/Wasm_Blink.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include <wasm3.h>
88

9-
#include <m3_api_defs.h>
10-
#include <m3_env.h>
11-
129
/*
1310
* Configuration
1411
*/

examples/Wasm_CoreMark/Wasm_CoreMark.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66

77
#include <wasm3.h>
8-
#include <m3_api_defs.h>
9-
#include <m3_env.h>
108

119
#include "coremark_minimal.wasm.h"
1210

examples/Wasm_Dino_ESP32_TDisplay/Wasm_Dino_ESP32_TDisplay.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "NotoSansBold15.h"
1010

1111
#include <wasm3.h>
12-
#include <m3_api_defs.h>
1312

1413
#define NATIVE_STACK_SIZE (32*1024)
1514

examples/Wasm_Dino_PyBadge/Wasm_Dino_PyBadge.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "Adafruit_Arcada.h"
88

99
#include <wasm3.h>
10-
#include <m3_api_defs.h>
1110

1211
#define DISPLAY_BRIGHTESS 128 // 0..255
1312

examples/Wasm_Fibonacci/Wasm_Fibonacci.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include <wasm3.h>
8-
#include <m3_config.h>
98

109
/*
1110
* WebAssembly app (recursive Fibonacci)

examples_pio/Wasm_Advanced/wasm_vm/wasm_vm.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <wasm3.h>
88

9-
#include <m3_api_defs.h>
109
#include <m3_env.h>
1110

1211
/*

src/m3_api_defs.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/m3_compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,8 @@ _ (PushAllocatedSlotAndEmit (o, i_type));
641641
{
642642
u16 constTableIndex = slot - o->slotFirstConstIndex;
643643

644+
d_m3Assert(constTableIndex < d_m3MaxConstantTableSize);
645+
644646
if (is64BitType)
645647
{
646648
u64 * constant = (u64 *) & o->constants [constTableIndex];

src/m3_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# endif
3434

3535
# ifndef d_m3MaxConstantTableSize
36-
# define d_m3MaxConstantTableSize 120
36+
# define d_m3MaxConstantTableSize 1024
3737
# endif
3838

3939
# ifndef d_m3MaxDuplicateFunctionImpl

src/m3_config_platforms.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@
6565

6666
# if defined(M3_COMPILER_MSVC)
6767
# define M3_WEAK //__declspec(selectany)
68+
# define M3_NO_UBSAN
6869
# elif defined(__MINGW32__)
6970
# define M3_WEAK //__attribute__((selectany))
71+
# define M3_NO_UBSAN
7072
# else
71-
# define M3_WEAK __attribute__((weak))
73+
# define M3_WEAK __attribute__((weak))
74+
# define M3_NO_UBSAN __attribute__((no_sanitize("undefined")))
7275
# endif
7376

7477
# ifndef M3_MIN
@@ -163,6 +166,9 @@ typedef int8_t i8;
163166
# ifndef d_m3VerboseErrorMessages
164167
# define d_m3VerboseErrorMessages 0
165168
# endif
169+
# ifndef d_m3MaxConstantTableSize
170+
# define d_m3MaxConstantTableSize 64
171+
# endif
166172
# ifndef d_m3MaxFunctionStackHeight
167173
# define d_m3MaxFunctionStackHeight 64
168174
# endif

0 commit comments

Comments
 (0)