1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Demangle/ms-md5.test
Nico Weber 48d7e19e9e llvm-undname: Make demangling of MD5 names more robust
Demangler::parse() for MD5 names would:

1. Put all remaining text into the MD5 name sight unseen
2. Not modify MangledName

This meant that if the demangler recursively called parse() (e.g. in
demangleLocallyScopedNamePiece()), every recursive call that started on
an MD5 name would add all remaining bytes to the output buffer but
only advance the input by a byte.  For valid inputs, MD5 types are
never (well, see comments for 2 exceptions) nested, but for invalid
input this could cause memory use quadratic in the input size.

llvm-svn: 361744
2019-05-27 00:48:59 +00:00

24 lines
900 B
Plaintext

; These tests are based on clang/test/CodeGenCXX/mangle-ms-md5.cpp
; RUN: llvm-undname < %s | FileCheck %s
; CHECK-NOT: Invalid mangled name
; MD5-mangled names start with ??@ and we should output them as is. We have
; two check lines here since the tool echos the input.
??@a6a285da2eea70dba6b578022be61d81@
; CHECK: ??@a6a285da2eea70dba6b578022be61d81@
; CHECK-NEXT: ??@a6a285da2eea70dba6b578022be61d81@
; Don't include trailing garbage:
??@a6a285da2eea70dba6b578022be61d81@asdf
; CHECK: ??@a6a285da2eea70dba6b578022be61d81@asdf
; CHECK-NEXT: ??@a6a285da2eea70dba6b578022be61d81@
; The complete object locator special case:
; FIXME: This should probably print
; ??@a6a285da2eea70dba6b578022be61d81@::`RTTI Complete Object Locator' instead.
??@a6a285da2eea70dba6b578022be61d81@??_R4@
; CHECK: ??@a6a285da2eea70dba6b578022be61d81@??_R4@
; CHECK-NEXT: ??@a6a285da2eea70dba6b578022be61d81@??_R4@