Skip to content
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

Ensure to escape characters before constructing JSON profile trace #21872

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

WojciechMazur
Copy link
Contributor

Fixes #21858 by setting up special escapes for characters that might corrupt the output JSON file produced by -Yprofile-trace

Copy link
Contributor

@prolativ prolativ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

// Based on NameTransformer but dedicated for JSON encoding rules
object JsonNameTransformer {
private val nops = 128
private val ncodes = 26 * 26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

Copy link
Member

@mbovel mbovel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit crazy to me that we need to rewrite a JSON escape function in 2024, but I guess this goes with the "no-dependency" policy of Dotty, and the fact that neither the Java nor the Scala standard libraries contain such function.

Otherwise looks okay to me!

@WojciechMazur WojciechMazur merged commit 6f48c39 into scala:main Nov 12, 2024
28 checks passed
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-Yprofile-trace doesn't correctly escape output
3 participants