From 6b8bcb1e07bf26ebef09a7211b0a37a446eafd52 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Wed, 2 Jun 2021 13:40:14 +0300 Subject: [PATCH] Fix build --- .github/workflows/tests.yml | 2 ++ extra/utils.mk | 16 ++++++++++++++++ source/m3_compile.c | 3 +-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 37a20a9..c0ed423 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -473,6 +473,8 @@ jobs: run: | cd platforms/embedded/particle particle compile --followSymlinks photon + particle compile --followSymlinks argon + particle compile --followSymlinks pi esp32-idf: runs-on: ubuntu-latest diff --git a/extra/utils.mk b/extra/utils.mk index 5be1c20..f5ce9ea 100644 --- a/extra/utils.mk +++ b/extra/utils.mk @@ -21,3 +21,19 @@ preprocess_restore: touch source/m3_compile.c +test_rv64: + riscv64-linux-gnu-gcc -DDEBUG -Dd_m3HasWASI \ + -I./source ./source/*.c ./platforms/app/main.c \ + -O3 -g0 -flto -lm -static \ + -o wasm3-rv64 + + cd test; python3 run-wasi-test.py --fast --exec "qemu-riscv64-static ../wasm3-rv64" + rm ./wasm3-rv64 + +test_cpp: + clang -xc++ -Dd_m3HasWASI \ + -I./source ./source/*.c ./platforms/app/main.c \ + -O3 -g0 -flto -lm -static \ + -o wasm3-cpp + cd test; python3 run-wasi-test.py --fast --exec "../wasm3-cpp" + rm ./wasm3-cpp diff --git a/source/m3_compile.c b/source/m3_compile.c index d8987a1..06446ef 100644 --- a/source/m3_compile.c +++ b/source/m3_compile.c @@ -2655,11 +2655,10 @@ M3Result CompileLocals (IM3Compilation o) { M3Result result; + u32 numLocals = 0; u32 numLocalBlocks; _ (ReadLEB_u32 (& numLocalBlocks, & o->wasm, o->wasmEnd)); - u32 numLocals = 0; - for (u32 l = 0; l < numLocalBlocks; ++l) { u32 varCount;