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

    <tr>
        <th>Summary</th>
        <td>
            Crash on running Kaleidoscope-Ch5 on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    Run Chapter 5 example:
`ready> extern putchard(char) def printstar(n) for i = 1, i < n in putchard(42);
ready> Read extern: declare double @putchard(double)

ready> Read function definition:define double @printstar(double %n) {
entry:
  br label %loop

loop: ; preds = %loop, %entry
  %i = phi double [ 1.000000e+00, %entry ], [ %nextvar, %loop ]
  %calltmp = call double @putchard(double 4.200000e+01)
  %nextvar = fadd double %i, 1.000000e+00
  %cmptmp = fcmp ult double %i, %n
  %booltmp = uitofp i1 %cmptmp to double
  %loopcond = fcmp one double %booltmp, 0.000000e+00
 br i1 %loopcond, label %loop, label %afterloop

afterloop: ; preds = %loop
  ret double 0.000000e+00
}

ready> printstar(100);
ready> ****************************************************************************************************Evaluated to 0.000000
ready> ^Z`

After ^Z and press Enter, the process crashes at the stack trace:
`       ucrtbase.dll!00007fff53dc286e() unknown
        vcruntime140.dll!00007fff3c596e4a()     unknown
>    Kaleidoscope-Ch5.exe!llvm::SectionMemoryManager::~SectionMemoryManager() line 237       C++
        [External Code] 
        Kaleidoscope-Ch5.exe!llvm::orc::RTDyldObjectLinkingLayer::handleRemoveResources(llvm::orc::JITDylib & JD, unsigned __int64 K) line 415      C++
        Kaleidoscope-Ch5.exe!llvm::orc::ExecutionSession::removeResourceTracker(llvm::orc::ResourceTracker & RT) line 2290  C++
        Kaleidoscope-Ch5.exe!llvm::orc::ResourceTracker::remove() line 53       C++
        Kaleidoscope-Ch5.exe!llvm::orc::JITDylib::clear() line 657      C++
        Kaleidoscope-Ch5.exe!llvm::orc::ExecutionSession::endSession() line 1907        C++
        Kaleidoscope-Ch5.exe!llvm::orc::KaleidoscopeJIT::~KaleidoscopeJIT() line 64     C++
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVl2P4yYU_TXkBW2EwXbihzzka6Sd3VWl7EiV-rLCcB3TIWABnp289LdXkC8nctuV5rWRJcMFzjmcC9fh3qu9AVigYoWKzYT3obVuEWy7b3s-qa08Lna9weuWdwEcLjC880OnAbElIhtElqgkDrg8IrbF8B7AGdz1QbTcSUTn8Y1ohSU0uHPKBB9iYG5isLEOK4zYBmeIrlNzjQ1Wdwg5RbRCbHViu1LtgMszH2JLLEFo7gBL29caMMrJAOIUjDAnxSNITW9EUNZEocqo2ERsmTp3oIMtXKK0SJtBs7NEMMEdr_ZgXDuseQ06ztTWdkMRqc-WGLEV7hxIn9y4TKTr2DzhncEQLU6Oda266ipWOJuS9ANEV4QMV2JUbFK_WCWt8B7eov71hSZNuMELrnU4dIkktv_NUpxP6Y02uzqMB0wJqOFS4pthKtI_SB4oOHQXAY04dLjX4XFtMv22orb2qrlXwTYdVtkAKtgzwGBN3LqwRt547CDVV8zIRsaU1u7McQGKM-8TPQzwJoB7TP8t-I9n4CzYwdWDMTVothk928PzmsVzMXKTEF3-__zis33juucBZDxSl0Q8-lls_0AlGeZjGfOcBjA3MmbZe7w1AdI9DC3gzlkRg8Jx34LHPKSwD1y84uC4uCu4GJGqFy7U3MNUao1oFoXMmqYpmBR0XgKi83Qdq968GvvzclsQqd6E601QB8hy8rCYiaIqIefjixHbIlJ94RqUtF7YDj6t22IK74BopvXbIUpky--QKuk3OFh3_MYN34M7jfw1OpS4sI6FlrIZItUa0VV8ropRsdqmSs81XlsJqWBVt_H_lGSdODV2L5ujlr_Vf4IIX5V5VWb_lR8v-lpupIYdHOwb7MDb3gnwiM5HgJ4_RyRVY0RL_JwKbG_Sp1TiHz-UCWWOv1z3lWfF2L5-Xff2HUQfrfsO3p--TYgt3Z3SF8fF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