diff options
| author | 2022-10-11 22:42:19 -0700 | |
|---|---|---|
| committer | 2022-10-11 22:42:19 -0700 | |
| commit | 40eca63653db107fe69fd0208cc994b0d922070f (patch) | |
| tree | 18f24a33ed0ae8b399d651b6e3121e7de36b8ac7 /src | |
| parent | e7eadcde5a17bd46dddba89b0baddc39d7ddb680 (diff) | |
| download | bun-40eca63653db107fe69fd0208cc994b0d922070f.tar.gz bun-40eca63653db107fe69fd0208cc994b0d922070f.tar.zst bun-40eca63653db107fe69fd0208cc994b0d922070f.zip | |
Fix crash when decoding latin1 rope strings and the GC is running
Diffstat (limited to '')
| -rw-r--r-- | src/bun.js/bindings/webcore/JSTextEncoder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bun.js/bindings/webcore/JSTextEncoder.cpp b/src/bun.js/bindings/webcore/JSTextEncoder.cpp index 52403e600..33d48b295 100644 --- a/src/bun.js/bindings/webcore/JSTextEncoder.cpp +++ b/src/bun.js/bindings/webcore/JSTextEncoder.cpp @@ -258,6 +258,7 @@ JSC_DEFINE_JIT_OPERATION(jsTextEncoderEncodeWithoutTypeCheck, JSC::EncodedJSValu String str; if (input->is8Bit()) { if (input->isRope()) { + GCDeferralContext gcDeferralContext(vm); auto encodedValue = TextEncoder__encodeRopeString(lexicalGlobalObject, input); if (!JSC::JSValue::decode(encodedValue).isUndefined()) { RELEASE_AND_RETURN(throwScope, encodedValue); @@ -416,7 +417,6 @@ static inline JSC::EncodedJSValue jsTextEncoderPrototypeFunction_encodeIntoBody( auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); - auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
