Repository navigation
Throw out of memory when JS_ReadObjectAtoms() cannot allocate an atom - #1976
Open
cognitivegears wants to merge 2 commits into
Open
cognitivegears wants to merge 2 commits into
cognitivegears wants to merge 2 commits into
Conversation
When resize_properties() can't grow a shape's property table, js_realloc() throws while the shape is off gc_obj_list. Creating the error can run the GC, which then calls list_del() on the unlinked shape. Reallocate with js_realloc_rt() and throw after relinking. Refs: quickjs-ng#1917
Under a memory limit, the first access to Array.fromAsync, Iterator.zip or Iterator.zipKeyed can fail in JS_ReadObjectAtoms() with nothing thrown, so a catch clause gets JS_UNINITIALIZED. Throw out of memory when __JS_NewAtom() fails. Also free js_bytecode_eval()'s arguments on failure, as in TelegramMessenger/quickjs@8ceed75 (John Preston); the test trips that leak otherwise.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under a memory limit, the first access to
Array.fromAsync,Iterator.ziporIterator.zipKeyedcan fail inJS_ReadObjectAtoms()with nothing thrown, so a catch clause getsJS_UNINITIALIZED. This is the engine's built-in bytecode, reached from ordinary source. It now throws out of memory when__JS_NewAtom()fails.Also frees
js_bytecode_eval()'s arguments on failure, as in TelegramMessenger/quickjs@8ceed75 (John Preston); the test trips that leak otherwise. The test needs #1975 first, so this branch is on top of it.Refs #1917
(Drafted with AI assistance.)