Fix an arithmetic overflow in reparser
This commit is contained in:
@@ -130,11 +130,11 @@ fn merge_errors(
|
||||
if e.offset() <= old_node.range().start() {
|
||||
res.push(e)
|
||||
} else if e.offset() >= old_node.range().end() {
|
||||
res.push(e.add_offset(TextUnit::of_str(&edit.insert) - edit.delete.len()));
|
||||
res.push(e.add_offset(TextUnit::of_str(&edit.insert), edit.delete.len()));
|
||||
}
|
||||
}
|
||||
for e in new_errors {
|
||||
res.push(e.add_offset(old_node.range().start()));
|
||||
res.push(e.add_offset(old_node.range().start(), 0.into()));
|
||||
}
|
||||
res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user