fastly / js-compute-runtime

JavaScript SDK and runtime for building Fastly Compute applications
https://developer.fastly.com/learning/compute/javascript/
Apache License 2.0
193 stars 26 forks source link

fix: Fix uses of cabi_realloc that were discarding their results #811

Closed elliottt closed 2 weeks ago

elliottt commented 2 weeks ago

Fix issues in some host calls where a buffer length error was being handled by reallocating to the new buffer size, but was discarding the new buffer's pointer. This should also fix flaky tests in CI.

It's unfortunate that cabi_realloc can't be marked [[nodiscard]], as it's defined within an extern "C" block.