summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-10-08 03:02:09 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-10-08 03:02:09 +0000
commita552480298c7774ecaabcef34f8025f5d16fa31d (patch)
treec89ff387c25ac191e88a0a035636d5e4070bb55c /libcxxabi/src
parenta082040deddc5760c728f61c3f6d9809631512ba (diff)
downloadbcm5719-llvm-a552480298c7774ecaabcef34f8025f5d16fa31d.tar.gz
bcm5719-llvm-a552480298c7774ecaabcef34f8025f5d16fa31d.zip
Fix incorrect parsing of arguments for nested functions. Reviewed as http://reviews.llvm.org/D13192. Thanks to Anseny Kapoulkine for the patch.
llvm-svn: 249649
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/cxa_demangle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp
index 2865bdeefe4..e6bf1675a2f 100644
--- a/libcxxabi/src/cxa_demangle.cpp
+++ b/libcxxabi/src/cxa_demangle.cpp
@@ -4054,7 +4054,7 @@ parse_nested_name(const char* first, const char* last, C& db,
// <discriminator> := _ <non-negative number> # when number < 10
// := __ <non-negative number> _ # when number >= 10
-// extension := decimal-digit+
+// extension := decimal-digit+ # at the end of string
const char*
parse_discriminator(const char* first, const char* last)
@@ -4083,7 +4083,8 @@ parse_discriminator(const char* first, const char* last)
const char* t1 = first+1;
for (; t1 != last && std::isdigit(*t1); ++t1)
;
- first = t1;
+ if (t1 == last)
+ first = last;
}
}
return first;
OpenPOWER on IntegriCloud