Skip to content

Commit

Permalink
Make string literals robust against non-printable characters
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 4, 2010
1 parent 31ea5d7 commit 3a5bf4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CodeGen.pm
Expand Up @@ -153,7 +153,11 @@ use 5.010;
# These are the sub-primitives. Their very inteface exposes volatile
# details of the codegen.

sub qm { "\"" . $_[0] . "\"" }
sub qm {
my $out = $_[0];
$out =~ s/"/""/g;
"@\"$out\"";
}

sub _savestackstate {
my ($self, $lbl) = @_;
Expand Down

0 comments on commit 3a5bf4e

Please sign in to comment.