aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-07-03 19:16:20 +0000
committerDJ Delorie <dj@redhat.com>2005-07-03 19:16:20 +0000
commit6ba85b8caf7b49723e475c3563995c44649e23b3 (patch)
tree5b4a6d142c7a5d949dd365dd5bd4c01b563b55e6 /libiberty/cp-demangle.c
parent2f4535c7eb76b6a7ceee2e8805a103cb8a90efee (diff)
downloadgdb-6ba85b8caf7b49723e475c3563995c44649e23b3.zip
gdb-6ba85b8caf7b49723e475c3563995c44649e23b3.tar.gz
gdb-6ba85b8caf7b49723e475c3563995c44649e23b3.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 6174439..8f1cfb1 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2337,7 +2337,11 @@ d_expr_primary (struct d_info *di)
}
s = d_str (di);
while (d_peek_char (di) != 'E')
- d_advance (di, 1);
+ {
+ if (d_peek_char (di) == '\0')
+ return NULL;
+ d_advance (di, 1);
+ }
ret = d_make_comp (di, t, type, d_make_name (di, s, d_str (di) - s));
}
if (d_next_char (di) != 'E')