diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 23dd73083be93..816e7b4dd81e0 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -488,9 +488,9 @@ DEPENDENCY_REPOSITORIES = dict( use_category = ["test"], ), proxy_wasm_cpp_sdk = dict( - sha256 = "e7c4bb34dda50aaf5815c24d76248a5a69d33d81db8e23a927701cbd1ee82791", - strip_prefix = "proxy-wasm-cpp-sdk-9cd9af9d357297f865d3612a722a69c7e1ee1541", - urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/9cd9af9d357297f865d3612a722a69c7e1ee1541.tar.gz"], + sha256 = "06f0f386dc8111082062f01e74e0c297e4a83857585519adb8727a3e7170f3b7", + strip_prefix = "proxy-wasm-cpp-sdk-558d45a2f496e3039e50584cf8304ae535ca73de", + urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/558d45a2f496e3039e50584cf8304ae535ca73de.tar.gz"], use_category = ["dataplane"], cpe = "N/A", ), diff --git a/test/extensions/bootstrap/wasm/test_data/segv_cpp.cc b/test/extensions/bootstrap/wasm/test_data/segv_cpp.cc index d6127a63d7da0..2f6f84cfabb3a 100644 --- a/test/extensions/bootstrap/wasm/test_data/segv_cpp.cc +++ b/test/extensions/bootstrap/wasm/test_data/segv_cpp.cc @@ -8,8 +8,6 @@ extern "C" PROXY_WASM_KEEPALIVE void proxy_abi_version_0_1_0() {} static int* badptr = nullptr; -int will_be_zero = 0; - extern "C" PROXY_WASM_KEEPALIVE uint32_t proxy_on_configure(uint32_t, uint32_t) { logError("before badptr"); *badptr = 1; @@ -17,8 +15,11 @@ extern "C" PROXY_WASM_KEEPALIVE uint32_t proxy_on_configure(uint32_t, uint32_t) return 1; } -extern "C" PROXY_WASM_KEEPALIVE void proxy_on_log(uint32_t) { +extern "C" PROXY_WASM_KEEPALIVE void proxy_on_log(uint32_t context_id) { logError("before div by zero"); - logError("divide by zero: " + std::to_string(100 / will_be_zero)); +#pragma clang optimize off + int zero = context_id / 1000; + logError("divide by zero: " + std::to_string(100 / zero)); +#pragma clang optimize on logError("after div by zero"); } diff --git a/test/extensions/common/wasm/test_data/test_cpp.cc b/test/extensions/common/wasm/test_data/test_cpp.cc index 72e83b7da78c3..465becc526be8 100644 --- a/test/extensions/common/wasm/test_data/test_cpp.cc +++ b/test/extensions/common/wasm/test_data/test_cpp.cc @@ -66,9 +66,11 @@ WASM_EXPORT(uint32_t, proxy_on_vm_start, (uint32_t context_id, uint32_t configur } else if (configuration == "divbyzero") { std::string message = "before div by zero"; proxy_log(LogLevel::error, message.c_str(), message.size()); - int zero = context_id / 1000; ::free(const_cast(reinterpret_cast(configuration_ptr))); +#pragma clang optimize off + int zero = context_id / 1000; message = "divide by zero: " + std::to_string(100 / zero); +#pragma clang optimize on proxy_log(LogLevel::error, message.c_str(), message.size()); } else if (configuration == "globals") { std::string message = "NaN " + std::to_string(gNan);