Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: gdb/findcmd.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/filesystem.c ('k') | gdb/findvar.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/findcmd.c
diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index 3fce2695919c096297bcb5d6df77f7c8f18bc33d..68184aa27e981cc0e675fa33e560ea0127071eb9 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -170,6 +170,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
{
LONGEST x;
int val_bytes;
+ ULONGEST pattern_buf_size_need;
while (isspace (*s))
++s;
@@ -179,12 +180,13 @@ parse_find_args (char *args, ULONGEST *max_countp,
/* Keep it simple and assume size == 'g' when watching for when we
need to grow the pattern buf. */
- if ((pattern_buf_end - pattern_buf + max (val_bytes, sizeof (int64_t)))
- > pattern_buf_size)
+ pattern_buf_size_need = (pattern_buf_end - pattern_buf
+ + max (val_bytes, sizeof (int64_t)));
+ if (pattern_buf_size_need > pattern_buf_size)
{
size_t current_offset = pattern_buf_end - pattern_buf;
- pattern_buf_size *= 2;
+ pattern_buf_size = pattern_buf_size_need * 2;
pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
pattern_buf_end = pattern_buf + current_offset;
}
« no previous file with comments | « gdb/filesystem.c ('k') | gdb/findvar.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698