Closed Bug 1394442 Opened 2 years ago Closed 2 years ago
Clear the Transcode buffer after decoding
At the moment, the bytecode buffer are kept alive after the evaluation as long as the script load request is alive. This is likely to be the issue reported in Bug 900784 comment 130. We have multiple option, we can: 1. Clear the bytecode buffer where the source buffer is cleared, after the call to EvaluateScript. 2. Move the bytecode buffer into the decoder function, having for side-effect of clearing the original buffer. 3. Clear the bytecode buffer in the decoder.
This patch implement the option 1 of comment 0, i-e to clear the bytecode buffer after the end of the EvaluateScript function call, where we are already cleaning the source. The check for IsBytecode is used to ensure that we were decoding, and never encoding. Thus keeping the SRI bits in the buffer if we might want to encode the script bytecode later.
Attachment #8901860 - Flags: review?(mrbkap)
Attachment #8901860 - Flags: review?(mrbkap) → review+
Testing on Try, attachment 8901860 [details] [diff] [review] does not seems to fix the issue reported in Bug 900784 comment 130.
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/33a50b654311 Clear the bytecode buffer after the evaluation. r=mrbkap
You need to log in before you can comment on or make changes to this bug.