mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 20:16:06 +00:00

stdcall name mangling requires a suffix with the number equal to the sum of the byte count of all parameter types. In the case of a function prototype that has a parameter type of an incomplete type it is impossible to get the size of the type. While such a function is not callable or able to be defined in the TU, it may still be mangled when generating debug info, which would previously lead to a crash.
This patch fixes that by simply bailing out of the loop and using the so far accumulated byte count. This matches GCCs behaviour as well: bc8d6c6013/gcc/config/i386/winnt.c (L203)
Fixes https://github.com/llvm/llvm-project/issues/52782
Differential Revision: https://reviews.llvm.org/D116020
11 lines
418 B
C++
11 lines
418 B
C++
// RUN: %clang_cc1 -triple i686-w64-windows-gnu -o - -emit-llvm -debug-info-kind=constructor %s | FileCheck %s
|
|
|
|
enum nsresult {};
|
|
|
|
class NotNull;
|
|
|
|
class nsICanvasRenderingContextInternal {
|
|
// CHECK: !DISubprogram(name: "InitializeWithDrawTarget", linkageName: "\01__ZN33nsICanvasRenderingContextInternal24InitializeWithDrawTargetE7NotNull@4"
|
|
nsresult __stdcall InitializeWithDrawTarget(NotNull);
|
|
} nsTBaseHashSet;
|