Changeset 262830 in webkit
- Timestamp:
- Jun 9, 2020, 7:04:14 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r262827 r262830 1 2020-06-09 Mark Lam <mark.lam@apple.com> 2 3 Stringifier::appendStringifiedValue() should not assume it is always safe to recurse. 4 https://bugs.webkit.org/show_bug.cgi?id=213006 5 <rdar://problem/64154840> 6 7 Reviewed by Keith Miller. 8 9 * stress/json-stringify-executing-in-reserved-zone.js: Added. 10 1 11 2020-06-09 Mark Lam <mark.lam@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r262827 r262830 1 2020-06-09 Mark Lam <mark.lam@apple.com> 2 3 Stringifier::appendStringifiedValue() should not assume it is always safe to recurse. 4 https://bugs.webkit.org/show_bug.cgi?id=213006 5 <rdar://problem/64154840> 6 7 Reviewed by Keith Miller. 8 9 In r262727, I suggested that Alexey Shvayka add an assertion in 10 Stringifier::appendStringifiedValue() to assert that it is safe to recurse because 11 we don't expect it to recurse into itself. Turns out this is a bad idea because 12 a client may be doing the recursing before calling Stringifier::appendStringifiedValue(). 13 As a result, Stringifier::appendStringifiedValue() ends up being executed with 14 the stack pointer already in the reserved zone. This is legal, and is what the 15 reserved zone is intended for as long as we don't recurse from here. However, 16 this also means that asserting vm.isSafeToRecurseSoft() here will surely fail 17 because we are already in the reserved zone area. The fix is simply to remove 18 this faulty assertion. 19 20 * runtime/JSONObject.cpp: 21 (JSC::Stringifier::appendStringifiedValue): 22 1 23 2020-06-09 Mark Lam <mark.lam@apple.com> 2 24 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r262727 r262830 1 1 /* 2 * Copyright (C) 2009-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2009-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 315 315 316 316 // Recursion is avoided by !holderStackWasEmpty check and do/while loop at the end of this method. 317 ASSERT(vm.isSafeToRecurseSoft()); 317 // We're having this recursion check here as a fail safe in case the code 318 // below get modified such that recursion is no longer avoided. 318 319 if (UNLIKELY(!vm.isSafeToRecurseSoft())) { 319 320 throwStackOverflowError(m_globalObject, scope);
Note:
See TracChangeset
for help on using the changeset viewer.