-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cyclic JSON.stringify / primitive conversion stack overflows #777
Commits on Oct 3, 2020
-
Add tests for cyclic conversions
These tests currently fail by overflowing the stack. Value comparisons are drawn from what Chrome and Firefox do, which doesn't appear to be in the spec?
Configuration menu - View commit details
-
Copy full SHA for 815f9b9 - Browse repository at this point
Copy the full SHA 815f9b9View commit details -
Add another test for a non-cyclic scenario
This test is likely to be broken by the next change
Configuration menu - View commit details
-
Copy full SHA for f30adf5 - Browse repository at this point
Copy the full SHA f30adf5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 340f0f4 - Browse repository at this point
Copy the full SHA 340f0f4View commit details -
Refactor the existing RecursionLimiter type
We can use the existing RecursionLimiter type used by GcObject's Debug impl for this purpose. We just need to refactor it to allow both liveness and visitation tracking, using a HashMap of ptrs to states instead of a HashSet of ptrs.
Configuration menu - View commit details
-
Copy full SHA for 877906f - Browse repository at this point
Copy the full SHA 877906fView commit details -
Fix
Value::to_json
to not overflow.Use the newly refactored RecursionLimiter to check for recursion, and limit it. Throw a TypeError as mandated by the spec.
Configuration menu - View commit details
-
Copy full SHA for e60fb64 - Browse repository at this point
Copy the full SHA e60fb64View commit details -
Fix ordinary_to_primitive to not overflow
Use the new RecursionLimiter type to prevent overflows from conversions in ordinary_to_primitive. The spec doesn't say what to do here, so we follow v8 / SpiderMonkey in returning a default value for the type hint -- either 0. or "". More details in the method documentation.
Configuration menu - View commit details
-
Copy full SHA for d043c9f - Browse repository at this point
Copy the full SHA d043c9fView commit details -
Merge branch 'master' into fix-cyclic-overflows
Someone added `as_gc_object` right as I added `add_gcobject`. What are the chances? Switched to the new method.
Configuration menu - View commit details
-
Copy full SHA for 8fa7bf9 - Browse repository at this point
Copy the full SHA 8fa7bf9View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd6e099 - Browse repository at this point
Copy the full SHA bd6e099View commit details
Commits on Oct 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2df908a - Browse repository at this point
Copy the full SHA 2df908aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e251e6 - Browse repository at this point
Copy the full SHA 6e251e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3300fe2 - Browse repository at this point
Copy the full SHA 3300fe2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30aadab - Browse repository at this point
Copy the full SHA 30aadabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cc55b9 - Browse repository at this point
Copy the full SHA 2cc55b9View commit details