summaryrefslogtreecommitdiff
path: root/compiler/utils/Json.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/Json.hs')
-rw-r--r--compiler/utils/Json.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/utils/Json.hs b/compiler/utils/Json.hs
index 1318ce2611..2bf00d3851 100644
--- a/compiler/utils/Json.hs
+++ b/compiler/utils/Json.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE GADTs #-}
module Json where
+import GhcPrelude
+
import Outputable
import Data.Char
import Numeric
@@ -39,7 +41,7 @@ escapeJsonString = concatMap escapeChar
escapeChar '\n' = "\\n"
escapeChar '\r' = "\\r"
escapeChar '\t' = "\\t"
- escapeChar '"' = "\""
+ escapeChar '"' = "\\\""
escapeChar '\\' = "\\\\"
escapeChar c | isControl c || fromEnum c >= 0x7f = uni_esc c
escapeChar c = [c]