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

    <tr>
        <th>Summary</th>
        <td>
            [LLVMJIT] setBitsSlowCase crashing. why?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```
$ wavm run  --mount-root . ./construct_fstream_from_syscall.wasm 
unhandled SIGSEGV
Call stack:
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::Errors::fatalfWithCallStack(char const*, ...)+134
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0+2744867
 /usr/lib/libc.so.6+250319
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMSupport.so.20.0git!llvm::APInt::setBitsSlowCase(unsigned int, unsigned int)+66
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/../lib/libLLVMAnalysis.so.20.0git+4896941
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/../lib/libLLVMAnalysis.so.20.0git+4916780
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/../lib/libLLVMAnalysis.so.20.0git!llvm::computeKnownBits(llvm::Value const*, llvm::KnownBits&, unsigned int, llvm::SimplifyQuery const&)+89
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+1602210
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+1631861
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+1634158
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+1553745
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+1574941
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+332624
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git+341757
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMInstCombine.so.20.0git!llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)+1359
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMCore.so.20.0git!llvm::FPPassManager::runOnFunction(llvm::Function&)+1608
 /home/cqwrteur/toolchains/llvm/x86_64-generic-linux-gnu/llvm/lib/libLLVMCore.so.20.0git!llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&)+82
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0+4033714
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::LLVMJIT::compileLLVMModule(WAVM::LLVMJIT::LLVMContext&, llvm::Module&&, bool, llvm::TargetMachine*)+41
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::LLVMJIT::compileModule(WAVM::IR::Module const&, WAVM::LLVMJIT::TargetSpec const&)+118
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::Runtime::loadBinaryModule(unsigned char const*, unsigned long, std::shared_ptr<WAVM::Runtime::Module>&, WAVM::IR::FeatureSpec const&, WAVM::WASM::LoadError*)+371
 wavm+248628
  wavm+247285
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::Platform::catchSignals(void (*)(void*), bool (*)(void*, WAVM::Platform::Signal, WAVM::Platform::CallStack&&), void*)+205
 /home/cqwrteur/softwares/wavm/x86_64-generic-linux-gnu/lib/libWAVM.so.0!WAVM::Runtime::catchRuntimeExceptions(std::function<void ()> const&, std::function<void (WAVM::Runtime::Exception*)> const&)+70
 wavm+246268
  wavm+245815
  /usr/lib/libc.so.6+155143
 /usr/lib/libc.so.6+139
  wavm+81232
Aborted (core dumped)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEWF1vozgU_TXOCwrC5vshD0laRtmdaruTUftYGTDgXWNn_dE0_35lCAm003RXmkylqiL2xefc48u918ZK0ZoTsgDhCoQ3M2x0I-RCy0IqKkk5y0V5WIDIO_55N8BbAhQ4e_zcOtJwx5nPW2G4nkshtOM6LkBZIbjS0hT6qVJaEtw-VVK0T-qgCsyYu8eqdfqlDG8wLxkpne3my_b2y0M_vMaMOUrj4m_gL_shB6CsES2xy_-zl5oYCVCmRKX3WBIFUGYpAZS9JNFTFMxrwomkxZxRbl7mNTcAZYzm_f_H5cOdq4TrAQTts0Xxl7dSCqn65wprzKpHqhvLZdtRQUnRYOl03gG0BGjtuK4LUArQCvrBdXmuUBwESRSfUYySY9vCGkbWMPR8mF5io4VgRYMpt3QY-5BOb3FC-vr14W5rdjshtcVEnuvVVAMEO8NOvuX9huv-URG9olptmdivsSIAJYZ3QVc6lGsr4vS3VTOKrkXf7tfUkyXH7KComriyCpI0SgP46TRSGMWJ98k0RhtbiHZnNPmdiz232wpQcp58wMyQyfdxnhu9Eb3d9LHllrY7RqvDn4bIw7Ba1AdGcu243nCl16LNKSfTnYCRhxC82k58DO_DJLpaPP4H-ACGyafBh6EfB-HnwcfBFZPBR_C-jyJ0sbxcFT2AcRh_Evoo82yOPQUVvLekvL7H6livpeF_8Mzwbn6SlM6D0VCqw2tnkbWQ7_qR3VvWd5jjmsj_Tz7yrv0VXiLPSI2Lw5TbyJ1Nu2Mnly47kqAr90uB5_sxvHJXNuoerXS_bb6fyyRlxI7didIw2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