From df822e7573363f82111c96a0b1d3f904fe812b55 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 17 Jun 2022 20:05:47 -0700 Subject: [PATCH] Append the function pointer type (#70923) The issue here was the recursion into PrettyPrintSigWorkerInternal that would reset the buffer. Now, we pass in a new buffer and append it when we return. --- src/coreclr/utilcode/prettyprintsig.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/coreclr/utilcode/prettyprintsig.cpp b/src/coreclr/utilcode/prettyprintsig.cpp index ac6d7db6847..f6b187099f0 100644 --- a/src/coreclr/utilcode/prettyprintsig.cpp +++ b/src/coreclr/utilcode/prettyprintsig.cpp @@ -788,8 +788,12 @@ static HRESULT PrettyPrintTypeA( break; case ELEMENT_TYPE_FNPTR: - IfFailGo(appendStrA(out, "fnptr ")); - IfFailGo(PrettyPrintSigWorkerInternal(typePtr, (typeEnd - typePtr), "", out,pIMDI)); + { + IfFailGo(appendStrA(out, "fnptr ")); + CQuickBytes qbOut; + IfFailGo(PrettyPrintSigWorkerInternal(typePtr, (typeEnd - typePtr), "", &qbOut,pIMDI)); + IfFailGo(appendStrA(out, (char *)qbOut.Ptr())); + } break; case ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG: -- GitLab