Skip to content

Commit

Permalink
Also prevent overflow in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 3, 2018
1 parent 3575be6 commit 9a16bbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_errors/emitter.rs
Expand Up @@ -1287,7 +1287,7 @@ impl EmitterWriter {
});

// length of the code to be substituted
let snippet_len = (span_end_pos - span_start_pos) as isize;
let snippet_len = span_end_pos as isize - span_start_pos as isize;
// For multiple substitutions, use the position *after* the previous
// substitutions have happened.
offset += full_sub_len - snippet_len;
Expand Down

0 comments on commit 9a16bbd

Please sign in to comment.