⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 241615 in webkit


Ignore:
Timestamp:
Feb 15, 2019, 1:41:15 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

SamplingProfiler::stackTracesAsJSON() should escape strings.
https://bugs.webkit.org/show_bug.cgi?id=194649
<rdar://problem/48072386>

Reviewed by Saam Barati.

JSTests:

  • stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
  • stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
  • stress/type-profiler-with-double-quote-in-field-name.js: Added.
  • stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.

Source/JavaScriptCore:

Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::stackTracesAsJSON):

  • runtime/TypeSet.cpp:

(JSC::TypeSet::toJSONString const):
(JSC::StructureShape::toJSONString const):

Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r241613 r241615  
     12019-02-15  Mark Lam  <mark.lam@apple.com>
     2
     3        SamplingProfiler::stackTracesAsJSON() should escape strings.
     4        https://bugs.webkit.org/show_bug.cgi?id=194649
     5        <rdar://problem/48072386>
     6
     7        Reviewed by Saam Barati.
     8
     9        * stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
     10        * stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
     11        * stress/type-profiler-with-double-quote-in-field-name.js: Added.
     12        * stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.
     13
    1142019-02-15  Robin Morisset  <rmorisset@apple.com>
    215        CodeBlock::jettison should clear related watchpoints
  • trunk/Source/JavaScriptCore/ChangeLog

    r241613 r241615  
     12019-02-15  Mark Lam  <mark.lam@apple.com>
     2
     3        SamplingProfiler::stackTracesAsJSON() should escape strings.
     4        https://bugs.webkit.org/show_bug.cgi?id=194649
     5        <rdar://problem/48072386>
     6
     7        Reviewed by Saam Barati.
     8
     9        Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().
     10
     11        * runtime/SamplingProfiler.cpp:
     12        (JSC::SamplingProfiler::stackTracesAsJSON):
     13        * runtime/TypeSet.cpp:
     14        (JSC::TypeSet::toJSONString const):
     15        (JSC::StructureShape::toJSONString const):
     16
    1172019-02-15  Robin Morisset  <rmorisset@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r241244 r241615  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    905905        for (StackFrame& stackFrame : stackTrace.frames) {
    906906            comma();
    907             json.append('"');
    908             json.append(stackFrame.displayNameForJSONTests(m_vm));
    909             json.append('"');
     907            json.appendQuotedJSONString(stackFrame.displayNameForJSONTests(m_vm));
    910908            loopedOnce = true;
    911909        }
  • trunk/Source/JavaScriptCore/runtime/TypeSet.cpp

    r233122 r241615  
    11/*
    2  * Copyright (C) 2014, 2015 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2014-2019 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    254254
    255255    json.appendLiteral("\"displayTypeName\":");
    256     json.append('"');
    257     json.append(displayName());
    258     json.append('"');
     256    json.appendQuotedJSONString(displayName());
    259257    json.append(',');
    260258
     
    443441
    444442    json.appendLiteral("\"constructorName\":");
    445     json.append('"');
    446     json.append(m_constructorName);
    447     json.append('"');
     443    json.appendQuotedJSONString(m_constructorName);
    448444    json.append(',');
    449445
     
    464460
    465461        String fieldName((*it).get());
    466         json.append('"');
    467         json.append(fieldName);
    468         json.append('"');
     462        json.appendQuotedJSONString(fieldName);
    469463    }
    470464    json.append(']');
     
    480474
    481475        String fieldName((*it).get());
    482         json.append('"');
    483         json.append(fieldName);
    484         json.append('"');
     476        json.appendQuotedJSONString(fieldName);
    485477    }
    486478    json.append(']');
Note: See TracChangeset for help on using the changeset viewer.