Skip to content

Commit

Permalink
in the VIR printer, if a string atom contains a newline, replace it w…
Browse files Browse the repository at this point in the history
…ith an escaped character

fixes a panic when printing the VIR
  • Loading branch information
utaal committed Aug 24, 2023
1 parent af00da5 commit 7b31831
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/vir/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<A: ToDebugSNode> ToDebugSNode for std::sync::Arc<A> {
impl ToDebugSNode for String {
fn to_node(&self, _opts: &ToDebugSNodeOpts) -> Node {
Node::Atom(match self.is_ascii() {
true => format!("\"{}\"", self),
true => format!("\"{}\"", self.replace("\n", "\\n")),
false => "non_ascii_string".to_string(),
})
}
Expand Down

0 comments on commit 7b31831

Please sign in to comment.