Fix for issue 6100: incorrect shrinking logic in ResizeContext() (#6102)
authorLaurentiu Cristofor <laurentiu.cristofor@outlook.com>
Fri, 4 Sep 2020 22:52:13 +0000 (15:52 -0700)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 22:52:13 +0000 (15:52 -0700)
src/reflection.cpp

index fcb225b54349175ceb2e169716885b053de97577..cb941a029fbfe5ee5408b4070300016dce75bb2b 100644 (file)
@@ -195,7 +195,7 @@ class ResizeContext {
     if (delta_ > 0)
       buf_.insert(buf_.begin() + start, delta_, 0);
     else
-      buf_.erase(buf_.begin() + start, buf_.begin() + start - delta_);
+      buf_.erase(buf_.begin() + start + delta_, buf_.begin() + start);
   }
 
   // Check if the range between first (lower address) and second straddles