[PATCH] D33393: [PATCH] Libcxxabi Demangler PR32890

Marcel Böhme via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 01:12:47 PDT 2017


FYI: Passes "make check-cxxabi" for LLVM in trunk on my machine (x86-64, Ubuntu 16.04) with following standard configuration:

lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:150: note: Using compiler: /usr/local/bin/clang++
lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:151: note: Using flags: ['-v', '-D_LIBCPP_DISABLE_AVAILABILITY']
lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:156: note: Using compile flags: ['-Werror=thread-safety', '-DLIBCXXABI_NO_TIMER', '-funwind-tables', '-std=c++1z', '-nostdinc++', '-I/src/try/llvm/projects/libcxx/include', '-I/src/try/llvm/projects/libcxxabi/include', '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-I/src/try/llvm/projects/libcxx/test/support']
lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:158: note: Using warnings: ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-argument', '-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', '-Wno-user-defined-literals', '-Wsign-compare', '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-Wno-conversion', '-Wno-unused-local-typedef', '-Wno-#warnings']
lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:159: note: Using link flags: ['-L/src/try/build/./lib', '-Wl,-rpath,/src/try/build/./lib', '-nodefaultlibs', '-lc++', '-lc++abi', '-lm', '-lgcc_s', '-lgcc', '-lpthread', '-lc', '-lgcc_s', '-lgcc']
lit.py: /src/try/llvm/projects/libcxx/utils/libcxx/test/config.py:162: note: Using available_features: ['thread-safety', 'glibc', 'diagnose-if-support', 'glibc-2.23', 'glibc-2', 'clang', 'ubuntu', 'linux', 'modules-support', 'clang-5', 'clang-5.0', 'ubuntu-16.04', 'verify-support', 'libcxxabi-has-system-unwinder', '-faligned-allocation', 'libc++', 'fsized-deallocation', 'long_tests', 'c++1z']

> On 22 May 2017, at 4:02 PM, Marcel Boehme via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> marcel created this revision.
> 
> Check whether the string (db.names.back().first) is longer than 7 characters before inserting another string at index 8.
> 
> 
> https://reviews.llvm.org/D33393
> 
> Files:
>  CREDITS.TXT
>  src/cxa_demangle.cpp
>  test/test_demangle.pass.cpp
> 
> 
> Index: test/test_demangle.pass.cpp
> ===================================================================
> --- test/test_demangle.pass.cpp
> +++ test/test_demangle.pass.cpp
> @@ -29665,6 +29665,7 @@
>     "\x44\x74\x70\x74\x71\x75\x32\x43\x41\x38\x65\x6E\x9B\x72\x4D\xC1\x43\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x38\xD3\x73\x9E\x2A\x37",
>     "\x46\x44\x74\x70\x74\x71\x75\x32\x43\x41\x72\x4D\x6E\x65\x34\x9F\xC1\x43\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x34\xD3\x73\x9E\x2A\x37\x72\x33\x8E\x3A\x29\x8E\x44\x35",
>        "_ZcvCiIJEEDvT__FFFFT_vT_v",
> +    "Z1JIJ1_T_EE3o00EUlT_E0",
> };
> 
> const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
> Index: src/cxa_demangle.cpp
> ===================================================================
> --- src/cxa_demangle.cpp
> +++ src/cxa_demangle.cpp
> @@ -3075,7 +3075,8 @@
>                 const char* t1 = t0 + 1;
>                 while (t1 != last && std::isdigit(*t1))
>                     ++t1;
> -                db.names.back().first.insert(db.names.back().first.begin()+7, t0, t1);
> +                if (db.names.back().first.length() > 7)
> +                  db.names.back().first.insert(db.names.back().first.begin() + 7, t0, t1);
>                 t0 = t1;
>             }
>             if (t0 == last || *t0 != '_')
> Index: CREDITS.TXT
> ===================================================================
> --- CREDITS.TXT
> +++ CREDITS.TXT
> @@ -12,6 +12,10 @@
> E: aaron at aaronballman.com
> D: Minor patches
> 
> +N: Marcel Boehme
> +E: marcel.boehme at acm.org
> +D: Minor patches
> +
> N: Logan Chien
> E: logan.chien at mediatek.com
> D: ARM EHABI Unwind & Exception Handling
> 
> 
> <D33393.99719.patch>



More information about the cfe-commits mailing list