Skip to content

Commit 5892439

Browse files
PiotrSikoralizanramaraochavaliTakeshi Yonedacmluciano
authored
Proxy-Wasm mega backport (#284)
* build: update rules_rust to allow Rustc in RBE (envoyproxy#13595) Signed-off-by: Lizan Zhou <lizan@tetrate.io> Signed-off-by: Piotr Sikora <piotrsikora@google.com> * fix macos v8 build (envoyproxy#13572) Signed-off-by: Rama Chavali <rama.rao@salesforce.com> * wasm: update proxy-wasm-cpp-host (envoyproxy#13606) The PR updates proxy-wasm-cpp-host dependency for enhancing the capability and fixing a bug in WASM extensions. The change consists of three PRs in proxy-wasm-cpp-host: 1. proxy-wasm/proxy-wasm-cpp-host#68 @PiotrSikora 2. proxy-wasm/proxy-wasm-cpp-host#65 @mathetake (me) 3. proxy-wasm/proxy-wasm-cpp-host#64 @mathetake (me) The code change can be found at proxy-wasm/proxy-wasm-cpp-host@49ed20e...c5658d3 . 1 & 2 enhance WASM capability, and 3 fixes a bug in situations where users share vm_id for multiple filters. For details, please take a look at these original PRs. Signed-off-by: mathetake <takeshi@tetrate.io> Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: re-enable tests with precompiled modules. (envoyproxy#13583) Fixes envoyproxy#12335. Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: flip the meaning of the "repository" in envoy_wasm_cc_binary(). (envoyproxy#13621) Change the meaning of the "repository" parameter to refer to an external Bazel repository, instead of using "@envoy" in targets that are included in the Envoy repository. This aligns with other envoy_* rules. Signed-off-by: Piotr Sikora <piotrsikora@google.com> * build: support ppc64le with wasm (envoyproxy#13657) The build has only been tested with gn git sha 5da62d5 as recommended by ppc64 maintainers of the v8 runtime. Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com> * wasm: remove no longer needed Emscripten metadata. (envoyproxy#13667) Signed-off-by: Piotr Sikora <piotrsikora@google.com> * fix wasm compilation (envoyproxy#13765) Signed-off-by: Asra Ali <asraa@google.com> * wasm: strip only Custom Sections with precompiled Wasm modules. (envoyproxy#13775) Signed-off-by: Piotr Sikora <piotrsikora@google.com> * build: don't build shared libraries for zlib and zlib-ng. (envoyproxy#13652) Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: update V8 to v8.7.220.10. (envoyproxy#13568) Signed-off-by: Piotr Sikora <piotrsikora@google.com> * build: exclude wee8/out from inputs (envoyproxy#13866) If you build without sandboxing for performance, the output files from this custom build genrule contained timestamps which caused it to rebuild every single build. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com> * tls: fix detection of the upstream connection close event. (envoyproxy#13858) Fixes envoyproxy#13856. Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: Force stop iteration after local response is sent (envoyproxy#13930) Resolves envoyproxy#13857 ref: -proxy-wasm/proxy-wasm-rust-sdk#44 -proxy-wasm/proxy-wasm-cpp-host#88 -proxy-wasm/proxy-wasm-cpp-host#93 Signed-off-by: mathetake <takeshi@tetrate.io> Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: fix order of callbacks for paused requests. (envoyproxy#13840) Fixes proxy-wasm/proxy-wasm-rust-sdk#43. Signed-off-by: Piotr Sikora <piotrsikora@google.com> * wasm: fix network leak (envoyproxy#13836) Signed-off-by: Kuat Yessenov <kuat@google.com> Co-authored-by: Lizan Zhou <lizan@tetrate.io> Co-authored-by: Rama Chavali <rama.rao@salesforce.com> Co-authored-by: Takeshi Yoneda <yoneda.takeshi.md@alumni.tsukuba.ac.jp> Co-authored-by: cmluciano <cmluciano@us.ibm.com> Co-authored-by: asraa <asraa@google.com> Co-authored-by: Keith Smiley <keithbsmiley@gmail.com> Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io> Co-authored-by: Kuat <kyessenov@users.noreply.github.com>
1 parent cd87e82 commit 5892439

File tree

24 files changed

+496
-157
lines changed

24 files changed

+496
-157
lines changed

.bazelrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ build:remote --spawn_strategy=remote,sandboxed,local
192192
build:remote --strategy=Javac=remote,sandboxed,local
193193
build:remote --strategy=Closure=remote,sandboxed,local
194194
build:remote --strategy=Genrule=remote,sandboxed,local
195-
# rules_rust is not remote runnable (yet)
196-
build:remote --strategy=Rustc=sandboxed,local
197195
build:remote --remote_timeout=7200
198196
build:remote --auth_enabled=true
199197
build:remote --remote_download_toplevel

bazel/external/wee8.BUILD

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ cc_library(
99
srcs = [
1010
"libwee8.a",
1111
],
12-
hdrs = [
13-
"wee8/include/v8-version.h",
14-
"wee8/third_party/wasm-api/wasm.hh",
12+
hdrs =
13+
glob([
14+
"wee8/include/**/*.h",
15+
"wee8/src/**/*.h",
16+
"wee8/third_party/wasm-api/wasm.hh",
17+
]),
18+
copts = [
19+
"-Wno-range-loop-analysis",
1520
],
1621
defines = ["ENVOY_WASM_V8"],
1722
includes = [
23+
"wee8",
1824
"wee8/include",
1925
"wee8/third_party",
2026
],
@@ -23,7 +29,10 @@ cc_library(
2329

2430
genrule(
2531
name = "build",
26-
srcs = glob(["wee8/**"]),
32+
srcs = glob(
33+
["wee8/**"],
34+
exclude = ["wee8/out/**"],
35+
),
2736
outs = [
2837
"libwee8.a",
2938
],

bazel/external/wee8.genrule_cmd

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
set -e
44

5-
# This works only on Linux-{x86_64,s390x,aarch64} and macOS-x86_64.
5+
# This works only on Linux-{x86_64,s390x,aarch64,ppc64le} and macOS-x86_64.
66
case "$$(uname -s)-$$(uname -m)" in
7-
Linux-x86_64|Linux-s390x|Linux-aarch64|Darwin-x86_64)
7+
Linux-x86_64|Linux-s390x|Linux-aarch64|Linux-ppc64le|Darwin-x86_64)
88
;;
99
*)
10-
echo "ERROR: wee8 is currently supported only on Linux-{x86_64,s390x,aarch64} and macOS-x86_64." >&2
10+
echo "ERROR: wee8 is currently supported only on Linux-{x86_64,s390x,aarch64,ppc64le} and macOS-x86_64." >&2
1111
exit 1
1212
esac
1313

@@ -19,7 +19,7 @@ pushd $$ROOT/wee8
1919
rm -rf out/wee8
2020

2121
# Export compiler configuration.
22-
export CXXFLAGS="$${CXXFLAGS-} -Wno-sign-compare -Wno-deprecated-copy -Wno-unknown-warning-option"
22+
export CXXFLAGS="$${CXXFLAGS-} -Wno-sign-compare -Wno-deprecated-copy -Wno-unknown-warning-option -Wno-range-loop-analysis -Wno-shorten-64-to-32"
2323
if [[ ( `uname` == "Darwin" && $${CXX-} == "" ) || $${CXX-} == *"clang"* ]]; then
2424
export IS_CLANG=true
2525
export CC=$${CC:-clang}
@@ -88,6 +88,11 @@ WEE8_BUILD_ARGS+=" v8_enable_shared_ro_heap=false"
8888
if [[ `uname -m` == "aarch64" ]]; then
8989
WEE8_BUILD_ARGS+=" target_cpu=\"arm64\""
9090
fi
91+
# Support ppc64
92+
# Only tests with gn 5da62d5
93+
if [[ `uname -m` == "ppc64le" ]]; then
94+
WEE8_BUILD_ARGS+=" target_cpu=\"ppc64\""
95+
fi
9196

9297
# Build wee8.
9398
if [[ -f /etc/centos-release ]] && [[ $$(cat /etc/centos-release) =~ "CentOS Linux release 7" ]] && [[ -x "$$(command -v gn)" ]]; then

bazel/external/wee8.patch

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# 1. Fix linking with unbundled toolchain on macOS.
22
# 2. Increase VSZ limit to 4TiB (allows us to start up to 409 VMs).
33
# 3. Fix MSAN linking.
4+
# 4. Fix Wasm module deserialization (http://crbug.com/v8/11024).
45
--- wee8/build/toolchain/gcc_toolchain.gni
56
+++ wee8/build/toolchain/gcc_toolchain.gni
6-
@@ -329,6 +329,8 @@ template("gcc_toolchain") {
7+
@@ -348,6 +348,8 @@ template("gcc_toolchain") {
78
# AIX does not support either -D (deterministic output) or response
89
# files.
910
command = "$ar -X64 {{arflags}} -r -c -s {{output}} {{inputs}}"
@@ -12,7 +13,7 @@
1213
} else {
1314
rspfile = "{{output}}.rsp"
1415
rspfile_content = "{{inputs}}"
15-
@@ -507,7 +509,7 @@ template("gcc_toolchain") {
16+
@@ -543,7 +545,7 @@ template("gcc_toolchain") {
1617

1718
start_group_flag = ""
1819
end_group_flag = ""
@@ -51,5 +52,17 @@
5152
- is_msan && (msan_track_origins == 0 || msan_track_origins == 2)
5253
+prebuilt_instrumented_libraries_available = false
5354

54-
if (use_libfuzzer && is_linux) {
55+
if (use_libfuzzer && (is_linux || is_chromeos)) {
5556
if (is_asan) {
57+
--- wee8/src/wasm/module-compiler.cc
58+
+++ wee8/src/wasm/module-compiler.cc
59+
@@ -2901,6 +2901,9 @@ void CompilationStateImpl::InitializeCompilationProgressAfterDeserialization() {
60+
RequiredBaselineTierField::encode(ExecutionTier::kTurbofan) |
61+
RequiredTopTierField::encode(ExecutionTier::kTurbofan) |
62+
ReachedTierField::encode(ExecutionTier::kTurbofan);
63+
+ finished_events_.Add(CompilationEvent::kFinishedExportWrappers);
64+
+ finished_events_.Add(CompilationEvent::kFinishedBaselineCompilation);
65+
+ finished_events_.Add(CompilationEvent::kFinishedTopTierCompilation);
66+
compilation_progress_.assign(module->num_declared_functions,
67+
kProgressAfterDeserialization);
68+
}

bazel/foreign_cc/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ envoy_cmake_external(
351351
envoy_cmake_external(
352352
name = "zlib",
353353
cache_entries = {
354-
"BUILD_SHARED_LIBS": "off",
355354
"CMAKE_CXX_COMPILER_FORCED": "on",
356355
"CMAKE_C_COMPILER_FORCED": "on",
357356
"SKIP_BUILD_EXAMPLES": "on",
357+
"BUILD_SHARED_LIBS": "off",
358358

359359
# The following entries are for zlib-ng. Since zlib and zlib-ng are compatible source
360360
# codes and CMake ignores unknown cache entries, it is fine to combine it into one
@@ -382,7 +382,7 @@ envoy_cmake_external(
382382
"//conditions:default": "@net_zlib//:all",
383383
}),
384384
static_libraries = select({
385-
"//bazel:windows_x86_64": ["zlibstatic.lib"],
385+
"//bazel:windows_x86_64": ["zlib.lib"],
386386
"//conditions:default": ["libz.a"],
387387
}),
388388
)

bazel/foreign_cc/zlib.patch

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,59 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 0fe939d..2f0475a 100644
2+
index e108c16..2cd82ef 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -229,21 +229,22 @@ endif()
5+
@@ -183,10 +183,18 @@ if(MINGW)
6+
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
7+
endif(MINGW)
8+
9+
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
10+
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
11+
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
12+
-set_target_properties(zlib PROPERTIES SOVERSION 1)
13+
+if(NOT DEFINED BUILD_SHARED_LIBS)
14+
+ add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
15+
+ add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
16+
+ set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
17+
+ set_target_properties(zlib PROPERTIES SOVERSION 1)
18+
+
19+
+ set(ZLIB_INSTALL_LIBRARIES zlib zlibstatic)
20+
+else()
21+
+ add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
22+
+
23+
+ set(ZLIB_INSTALL_LIBRARIES zlib)
24+
+endif()
25+
26+
if(NOT CYGWIN)
27+
# This property causes shared libraries on Linux to have the full version
28+
@@ -196,22 +204,22 @@ if(NOT CYGWIN)
29+
#
30+
# This has no effect with MSVC, on that platform the version info for
31+
# the DLL comes from the resource file win32/zlib1.rc
32+
- set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
33+
+ set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES VERSION ${ZLIB_FULL_VERSION})
34+
endif()
35+
36+
if(UNIX)
37+
# On unix-like platforms the library is almost always called libz
38+
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
39+
+ set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES OUTPUT_NAME z)
40+
if(NOT APPLE)
41+
- set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
42+
+ set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
43+
endif()
44+
elseif(BUILD_SHARED_LIBS AND WIN32)
45+
# Creates zlib1.dll when building shared library version
46+
- set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
47+
+ set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES SUFFIX "1.dll")
48+
endif()
49+
50+
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
51+
- install(TARGETS zlib zlibstatic
52+
+ install(TARGETS ${ZLIB_INSTALL_LIBRARIES}
53+
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
54+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
55+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
56+
@@ -229,21 +237,22 @@ endif()
657
#============================================================================
758
# Example binaries
859
#============================================================================

bazel/repository_locations.bzl

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,10 @@ DEPENDENCY_REPOSITORIES_SPEC = dict(
689689
project_name = "V8",
690690
project_desc = "Google’s open source high-performance JavaScript and WebAssembly engine, written in C++",
691691
project_url = "https://v8.dev",
692-
version = "8.5.210.20",
692+
version = "8.7.220.10",
693693
# This archive was created using https://storage.googleapis.com/envoyproxy-wee8/wee8-archive.sh
694694
# and contains complete checkout of V8 with all dependencies necessary to build wee8.
695-
sha256 = "ef404643d7da6854b76b9fb9950a79a1acbd037b7a26f02c585ac379b0f7dee1",
695+
sha256 = "f22734640e0515bc34d1ca3772513aef24374fafa44d0489d3a9a57cadec69fb",
696696
urls = ["https://storage.googleapis.com/envoyproxy-wee8/wee8-{version}.tar.gz"],
697697
use_category = ["dataplane_ext"],
698698
extensions = [
@@ -702,7 +702,7 @@ DEPENDENCY_REPOSITORIES_SPEC = dict(
702702
"envoy.filters.network.wasm",
703703
"envoy.stat_sinks.wasm",
704704
],
705-
last_updated = "2020-08-31",
705+
last_updated = "2020-10-27",
706706
cpe = "cpe:2.3:a:google:v8:*",
707707
),
708708
com_googlesource_quiche = dict(
@@ -869,9 +869,8 @@ DEPENDENCY_REPOSITORIES_SPEC = dict(
869869
project_name = "WebAssembly for Proxies (C++ host implementation)",
870870
project_desc = "WebAssembly for Proxies (C++ host implementation)",
871871
project_url = "https://github.com/proxy-wasm/proxy-wasm-cpp-host",
872-
# 2020-09-10
873-
version = "49ed20e895b728aae6b811950a2939ecbaf76f7c",
874-
sha256 = "fa03293d01450b9164f8f56ef9227301f7d1af4f373f996400f75c93f6ebc822",
872+
version = "a044a3a5bec75ce57c12d9e2b0e95e2a14f9f944",
873+
sha256 = "619e61997682931e07e92f5b64a4268715598d3aa22a41cadeeca816103d731f",
875874
strip_prefix = "proxy-wasm-cpp-host-{version}",
876875
urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-host/archive/{version}.tar.gz"],
877876
use_category = ["dataplane_ext"],
@@ -882,7 +881,7 @@ DEPENDENCY_REPOSITORIES_SPEC = dict(
882881
"envoy.filters.network.wasm",
883882
"envoy.stat_sinks.wasm",
884883
],
885-
last_updated = "2020-07-29",
884+
last_updated = "2020-11-12",
886885
cpe = "N/A",
887886
),
888887
# TODO: upgrade to the latest version (1.41 currently fails tests)
@@ -904,14 +903,14 @@ DEPENDENCY_REPOSITORIES_SPEC = dict(
904903
project_name = "Bazel rust rules",
905904
project_desc = "Bazel rust rules (used by Wasm)",
906905
project_url = "https://github.com/bazelbuild/rules_rust",
907-
version = "fda9a1ce6482973adfda022cadbfa6b300e269c3",
908-
sha256 = "484a2b2b67cd2d1fa1054876de7f8d291c4b203fd256bc8cbea14d749bb864ce",
906+
version = "fb90a7484800157fbb8a5904fbeb608dc1effc0c",
907+
sha256 = "cbb253b8c5ab1a3c1787790f900e7d6774e95ba038714fc0f710935e62f30f5f",
909908
# Last commit where "out_binary = True" works.
910909
# See: https://github.com/bazelbuild/rules_rust/issues/386
911910
strip_prefix = "rules_rust-{version}",
912911
urls = ["https://github.com/bazelbuild/rules_rust/archive/{version}.tar.gz"],
913-
use_category = ["build"],
914-
last_updated = "2020-07-29",
912+
use_category = ["test_only"],
913+
last_updated = "2020-10-15",
915914
),
916915
rules_antlr = dict(
917916
project_name = "ANTLR Rules for Bazel",

bazel/wasm/wasm.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def wasm_cc_binary(name, tags = [], repository = "", **kwargs):
8888
kwargs.setdefault("additional_linker_inputs", ["@proxy_wasm_cpp_sdk//:jslib", "@envoy//source/extensions/common/wasm/ext:jslib"])
8989

9090
if repository == "@envoy":
91-
envoy_js = "--js-library source/extensions/common/wasm/ext/envoy_wasm_intrinsics.js"
92-
else:
9391
envoy_js = "--js-library external/envoy/source/extensions/common/wasm/ext/envoy_wasm_intrinsics.js"
92+
else:
93+
envoy_js = "--js-library source/extensions/common/wasm/ext/envoy_wasm_intrinsics.js"
9494
kwargs.setdefault("linkopts", [
9595
envoy_js,
9696
"--js-library external/proxy_wasm_cpp_sdk/proxy_wasm_intrinsics.js",
@@ -112,10 +112,10 @@ def wasm_cc_binary(name, tags = [], repository = "", **kwargs):
112112
)
113113

114114
def envoy_wasm_cc_binary(name, tags = [], **kwargs):
115-
wasm_cc_binary(name, tags, repository = "@envoy", **kwargs)
115+
wasm_cc_binary(name, tags, repository = "", **kwargs)
116116

117117
def wasm_rust_binary(name, tags = [], **kwargs):
118-
wasm_name = "_wasm_" + (name if not ".wasm" in name else name.strip(".wasm"))
118+
wasm_name = "_wasm_" + name.replace(".", "_")
119119
kwargs.setdefault("visibility", ["//visibility:public"])
120120

121121
rust_binary(

docs/root/version_history/current.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Bug Fixes
7878
* rocketmq_proxy: fixed an issue involving incorrect header lengths. In debug mode it causes crash and in release mode it causes underflow.
7979
* thrift_proxy: fixed crashing bug on request overflow.
8080
* udp_proxy: fixed a crash due to UDP packets being processed after listener removal.
81+
* tls: fix detection of the upstream connection close event.
8182

8283
Removed Config or Runtime
8384
-------------------------

source/extensions/common/wasm/context.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -853,11 +853,7 @@ BufferInterface* Context::getBuffer(WasmBufferType type) {
853853
void Context::onDownstreamConnectionClose(CloseType close_type) {
854854
ContextBase::onDownstreamConnectionClose(close_type);
855855
downstream_closed_ = true;
856-
// Call close on TCP connection, if upstream connection closed or there was a failure seen in
857-
// this connection.
858-
if (upstream_closed_ || getRequestStreamInfo()->hasAnyResponseFlag()) {
859-
onCloseTCP();
860-
}
856+
onCloseTCP();
861857
}
862858

863859
void Context::onUpstreamConnectionClose(CloseType close_type) {
@@ -1488,12 +1484,14 @@ WasmResult Context::continueStream(WasmStreamType stream_type) {
14881484
switch (stream_type) {
14891485
case WasmStreamType::Request:
14901486
if (decoder_callbacks_) {
1491-
decoder_callbacks_->continueDecoding();
1487+
// We are in a reentrant call, so defer.
1488+
wasm()->addAfterVmCallAction([this] { decoder_callbacks_->continueDecoding(); });
14921489
}
14931490
break;
14941491
case WasmStreamType::Response:
14951492
if (encoder_callbacks_) {
1496-
encoder_callbacks_->continueEncoding();
1493+
// We are in a reentrant call, so defer.
1494+
wasm()->addAfterVmCallAction([this] { encoder_callbacks_->continueEncoding(); });
14971495
}
14981496
break;
14991497
default:

0 commit comments

Comments
 (0)