Skip to content

Commit

Permalink
[JVM] Don't use native string arrays in setting
Browse files Browse the repository at this point in the history
As already pointed out in e22aeaf these blow up on the
JVM backend.

This should fix #3695.

The problem only surfaced during installation on Windows, because
there pathes contain backslashes that need to be escaped in JSON.
  • Loading branch information
usev6 committed May 20, 2020
1 parent 16d93e2 commit 2b81f97
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core.c/Rakudo/Internals/JSON.pm6
Expand Up @@ -426,8 +426,14 @@ my class Rakudo::Internals::JSON {
$raw = $startcombiner ~ $raw
}
if not $has_treacherous and not $has_hexcodes and $escape_counts {
#?if !jvm
my str @a;
my str @b;
#?endif
#?if jvm
my @a;
my @b;
#?endif
if nqp::existskey($escape_counts, "n") and nqp::existskey($escape_counts, "r") {
@a.push("\\r\\n"); @b.push("\r\n");
}
Expand All @@ -454,7 +460,12 @@ my class Rakudo::Internals::JSON {
$raw = $raw.subst(/ \\ (<-[uU]>) || [\\ (<[uU]>) (<[a..f 0..9 A..F]> ** 3)]+ %(<[a..f 0..9 A..F]>) (:m <[a..f 0..9 A..F]>) /,
-> $/ {
if $0.elems > 1 || $0.Str eq "u" || $0.Str eq "U" {
#?if !jvm
my str @caps = $/.caps>>.value>>.Str;
#?endif
#?if jvm
my @caps = $/.caps>>.value>>.Str;
#?endif
my $result = $/;
my str $endpiece = "";
if my $lastchar = nqp::chr(nqp::ord(@caps.tail)) ne @caps.tail {
Expand Down

0 comments on commit 2b81f97

Please sign in to comment.