aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing
diff options
context:
space:
mode:
authorpcpthm <[email protected]>2019-03-21 17:22:06 +0000
committerpcpthm <[email protected]>2019-03-21 23:09:11 +0000
commit0acb61a911659537c51daf6793c67ef0c2b55bc9 (patch)
tree1eda85ba930c16ae378be638d392c4a624bd9429 /crates/ra_syntax/src/parsing
parent4c7142d0c9be90c8947deb788993d903b2e0a5d1 (diff)
Fix an arithmetic overflow in reparser
Diffstat (limited to 'crates/ra_syntax/src/parsing')
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs
index ba77a3b6c..b44cca49d 100644
--- a/crates/ra_syntax/src/parsing/reparsing.rs
+++ b/crates/ra_syntax/src/parsing/reparsing.rs
@@ -130,11 +130,11 @@ fn merge_errors(
130 if e.offset() <= old_node.range().start() { 130 if e.offset() <= old_node.range().start() {
131 res.push(e) 131 res.push(e)
132 } else if e.offset() >= old_node.range().end() { 132 } else if e.offset() >= old_node.range().end() {
133 res.push(e.add_offset(TextUnit::of_str(&edit.insert) - edit.delete.len())); 133 res.push(e.add_offset(TextUnit::of_str(&edit.insert), edit.delete.len()));
134 } 134 }
135 } 135 }
136 for e in new_errors { 136 for e in new_errors {
137 res.push(e.add_offset(old_node.range().start())); 137 res.push(e.add_offset(old_node.range().start(), 0.into()));
138 } 138 }
139 res 139 res
140} 140}