Skip to content

Commit 0d82197

Browse files
committed
Move n variable usage to allow for DCE
1 parent 1fcbb0d commit 0d82197

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gdbstub_impl/ext/single_register_access.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ impl<T: Target, C: Connection> GdbStubImpl<T, C> {
3131
// If the register has a known size and read_register attempts
3232
// to send more bytes than are present in the register,
3333
// error out and stop sending data.
34-
n += buf.len();
3534
if let Some(size) = reg_size {
35+
n += buf.len();
36+
3637
if n > size.get() {
3738
err = Err(Error::TargetMismatch);
3839
return;

0 commit comments

Comments
 (0)