-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
8dc420e
to
2f61ee2
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
There was a problem hiding this 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!
compiler/src/dotty/tools/dotc/profile/JsonNameTransformer.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Matt Bovel <[email protected]>
Fixes #21858 by setting up special escapes for characters that might corrupt the output JSON file produced by
-Yprofile-trace