<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56449>56449</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLDB crashes when printing a member pointer variable on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb,
            platform:windows
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            ZequanWu
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ZequanWu
      </td>
    </tr>
</table>

<pre>
    Example code:
```
struct S {
    void func1() {}
};

int main() {
    void (S::* ptr_func1) () = &S::func1;
    S s;
    (s.*ptr_func1)();
    return 0;
}
```
The following command crashes lldb:
`lldb -O "target create a.exe" -o "b a.cpp:9" -o "run" -o "p ptr_func1"`

```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: C:\\src\\llvm-project\\build\\debug\\bin\\lldb.exe -O "target create a.exe" -o "b a.cpp:9" -o run -o "p ptr_func1"
 #0 0x00007ffc0466073d common_assert_to_message_box<wchar_t> C:\src\llvm-project\build\debug\minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:388:0
 #1 0x00007ffbfe9bd92d clang::CXXRecordDecl::getMSInheritanceModel(void) const C:\src\llvm-project\clang\lib\AST\MicrosoftCXXABI.cpp:237:0
 #2 0x00007ffbfe9be4a3 getMSMemberPointerSlots C:\src\llvm-project\clang\lib\AST\MicrosoftCXXABI.cpp:284:0
 #3 0x00007ffbfe9bdd35 `anonymous namespace'::MicrosoftCXXABI::getMemberPointerInfo C:\src\llvm-project\clang\lib\AST\MicrosoftCXXABI.cpp:310:0
 #4 0x00007ffbfd8694d8 clang::ASTContext::getTypeInfoImpl(class clang::Type const *) const C:\src\llvm-project\clang\lib\AST\ASTContext.cpp:2265:0
 #5 0x00007ffbfd86b16a clang::ASTContext::getTypeInfo(class clang::Type const *) const C:\src\llvm-project\clang\lib\AST\ASTContext.cpp:1925:0
 #6 0x00007ffbfd1f10f5 clang::ASTContext::getTypeInfo(class clang::QualType) const C:\src\llvm-project\clang\include\clang\AST\ASTContext.h:2279:0
 #7 0x00007ffbfd1ea3ab clang::ASTContext::getTypeSize(class clang::QualType) const C:\src\llvm-project\clang\include\clang\AST\ASTContext.h:2285:0
 #8 0x00007ffbfd1cdd4d lldb_private::TypeSystemClang::GetBitSize(void *, class lldb_private::ExecutionContextScope *) C:\src\llvm-project\lldb\source\Plugins\TypeSystem\Clang\TypeSystemClang.cpp:4724:0
 #9 0x00007ffbfcf4c54b lldb_private::CompilerType::GetBitSize(class lldb_private::ExecutionContextScope *) const C:\src\llvm-project\lldb\source\Symbol\CompilerType.cpp:484:0
#10 0x00007ffbfcf4c5c3 lldb_private::CompilerType::GetByteSize(class lldb_private::ExecutionContextScope *) const C:\src\llvm-project\lldb\source\Symbol\CompilerType.cpp:490:0
#11 0x00007ffbfd5dc3a4 lldb_private::Value::GetValueAsData(class lldb_private::ExecutionContext *, class lldb_private::DataExtractor &, class lldb_private::Module *) C:\src\llvm-project\lldb\source\Core\Value.cpp:310:0
#12 0x00007ffbfced07a3 lldb_private::ValueObjectVariable::UpdateValue(void) C:\src\llvm-project\lldb\source\Core\ValueObjectVariable.cpp:234:0
#13 0x00007ffbfceb87bf lldb_private::ValueObject::UpdateValueIfNeeded(bool) C:\src\llvm-project\lldb\source\Core\ValueObject.cpp:168:0
#14 0x00007ffbfceb913a lldb_private::ValueObject::GetError(void) C:\src\llvm-project\lldb\source\Core\ValueObject.cpp:284:0
#15 0x00007ffbfee0f8fc EntityVariable::Materialize(class std::shared_ptr<class lldb_private::StackFrame> &, class lldb_private::IRMemoryMap &, unsigned __int64, class lldb_private::Status &) C:\src\llvm-project\lldb\source\Expression\Materializer.cpp:452:0
#16 0x00007ffbfee0b4ff lldb_private::Materializer::Materialize(class std::shared_ptr<class lldb_private::StackFrame> &, class lldb_private::IRMemoryMap &, unsigned __int64, class lldb_private::Status &) C:\src\llvm-project\lldb\source\Expression\Materializer.cpp:1373:0
#17 0x00007ffbfee09b67 lldb_private::LLVMUserExpression::PrepareToExecuteJITExpression(class lldb_private::DiagnosticManager &, class lldb_private::ExecutionContext &, unsigned __int64 &) C:\src\llvm-project\lldb\source\Expression\LLVMUserExpression.cpp:358:0
#18 0x00007ffbfee08b90 lldb_private::LLVMUserExpression::DoExecute(class lldb_private::DiagnosticManager &, class lldb_private::ExecutionContext &, class lldb_private::EvaluateExpressionOptions const &, class std::shared_ptr<class lldb_private::UserExpression> &, class std::shared_ptr<class lldb_private::ExpressionVariable> &) C:\src\llvm-project\lldb\source\Expression\LLVMUserExpression.cpp:82:0
#19 0x00007ffbfd4ced59 lldb_private::UserExpression::Execute(class lldb_private::DiagnosticManager &, class lldb_private::ExecutionContext &, class lldb_private::EvaluateExpressionOptions const &, class std::shared_ptr<class lldb_private::UserExpression> &, class std::shared_ptr<class lldb_private::ExpressionVariable> &) C:\src\llvm-project\lldb\source\Expression\UserExpression.cpp:396:0
#20 0x00007ffbfd4ce854 lldb_private::UserExpression::Evaluate(class lldb_private::ExecutionContext &, class lldb_private::EvaluateExpressionOptions const &, class llvm::StringRef, class llvm::StringRef, class std::shared_ptr<class lldb_private::ValueObject> &, class lldb_private::Status &, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> *, class lldb_private::ValueObject *) C:\src\llvm-project\lldb\source\Expression\UserExpression.cpp:342:0
#21 0x00007ffbfd03e262 lldb_private::Target::EvaluateExpression(class llvm::StringRef, class lldb_private::ExecutionContextScope *, class std::shared_ptr<class lldb_private::ValueObject> &, class lldb_private::EvaluateExpressionOptions const &, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> *, class lldb_private::ValueObject *) C:\src\llvm-project\lldb\source\Target\Target.cpp:2518:0
#22 0x00007ffbfd69da1f lldb_private::CommandObjectExpression::EvaluateExpression(class llvm::StringRef, class lldb_private::Stream &, class lldb_private::Stream &, class lldb_private::CommandReturnObject &) C:\src\llvm-project\lldb\source\Commands\CommandObjectExpression.cpp:418:0
#23 0x00007ffbfd69eace lldb_private::CommandObjectExpression::DoExecute(class llvm::StringRef, class lldb_private::CommandReturnObject &) C:\src\llvm-project\lldb\source\Commands\CommandObjectExpression.cpp:642:0
#24 0x00007ffbfcf3353a lldb_private::CommandObjectRaw::Execute(char const *, class lldb_private::CommandReturnObject &) C:\src\llvm-project\lldb\source\Interpreter\CommandObject.cpp:1020:0
#25 0x00007ffbfcf15b6c lldb_private::CommandInterpreter::HandleCommand(char const *, enum lldb_private::LazyBool, class lldb_private::CommandReturnObject &) C:\src\llvm-project\lldb\source\Interpreter\CommandInterpreter.cpp:1989:0
#26 0x00007ffbfcf1a4e3 lldb_private::CommandInterpreter::IOHandlerInputComplete(class lldb_private::IOHandler &, class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> &) C:\src\llvm-project\lldb\source\Interpreter\CommandInterpreter.cpp:3065:0
#27 0x00007ffbfd4f482f lldb_private::IOHandlerEditline::Run(void) C:\src\llvm-project\lldb\source\Core\IOHandler.cpp:587:0
#28 0x00007ffbfce143d2 lldb_private::Debugger::RunIOHandlers(void) C:\src\llvm-project\lldb\source\Core\Debugger.cpp:1017:0
#29 0x00007ffbfcf1babe lldb_private::CommandInterpreter::RunCommandInterpreter(class lldb_private::CommandInterpreterRunOptions &) C:\src\llvm-project\lldb\source\Interpreter\CommandInterpreter.cpp:3314:0
#30 0x00007ffbfccc148f lldb::SBDebugger::RunCommandInterpreter(class lldb::SBCommandInterpreterRunOptions const &) C:\src\llvm-project\lldb\source\API\SBDebugger.cpp:1234:0
#31 0x00007ff709033e94 Driver::MainLoop(void) C:\src\llvm-project\lldb\tools\driver\Driver.cpp:576:0
#32 0x00007ff709034a7e main C:\src\llvm-project\lldb\tools\driver\Driver.cpp:851:0
#33 0x00007ff709192790 invoke_main d:\a01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#34 0x00007ff709192790 __scrt_common_main_seh d:\a01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#35 0x00007ffc7f2e7034 (C:\Windows\System32\KERNEL32.DLL+0x17034)
#36 0x00007ffc80822651 (C:\Windows\SYSTEM32\ntdll.dll+0x52651)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWllz47gR_jXyC2pUJHg_-MGWtIkSe8exvLPHiwoEQYkZimBA0Mf--jR4iARFy5Y9nkml1iVLJI7G1183Gw0QIY-ezhePZJenDFEesYl1MTHmE-Ni4hrNp7otpCipRCs08S7rEgR_9zyJUFxm1Jxgf4KDqtabNxLgwmoa199JJtGOJFmvsS4KKlYKAXzwBcqlWDfCA9T2seZw6Tat6lqrJ2aFCu0euhVTENaXVYvSmgkmS5EhowO810Ln4W7LUMzTlD8k2QYY2-1IFiEqSLFlBUrTKOwzqO7Rp8-AAksiNkxCS0YkQ2TKHhmUok9cVYZQQPMcugZdoSiz7ibvs4H3cEYx3lwtLlYLVJThLpGIoLDcgII5FxJJjrZS5kXF8E_w2SRyW4ZTUARu0vS-_fmUC_5vRiXcJkVRsgIukFI1yWhaRgxJIKJSG4WEfpWCUDath19JKEBRucv3VBhTVP3dCL4RZIeAi3LHMqlwoJlq5szgUwhaX2gIqpKwTNKovowYKNSUgi81HaJQUfo2soHpcZpr_5hgy0DGowF_XhxTw3Zdw7Oiyvo8W5OiYEKuJV_vWFGQDVuH_HFizR7oloi1nFiLVsVav4FyrWatWrsk-8pExlK4pgIocmYl_O67kzxvbkFLWeaqqELQKGX5PnwbHXazwx7GLAijAAP2lGSb-iGa_fbbLaNcRHNG07oIyLteLbMtE4kkGWXXEBlSeGzUQ6qeQsqzQh7VqpYPxUkI3xerO_i-TqjgBY8ljHhxuWzwYsvT8eIBXmYTC1WIrtkuZOKGQxxhYpVyWXwrDL6tY7CGnEWWg-ABIxnPnna8LFBGwNo5eP0EezVpA9Edk33Uyyzm3wi0ZRo6aLsPOvLdwI78vqFB2IwDiEe5x3b3lDMFaQk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