Skip to content

Commit 03e2e80

Browse files
adamperlinAdam Perlin
andauthored
[Wasm RyuJIT] Fix: Use passed in ig when possible for IF_CODE_SIZE in emitDispIns() (#128172)
We can't always rely on `emitCurIG` being set since `emitDispIns` can be called after codegen, so use the current passed in ig when possible in for `IF_CODE_SIZE` in `emitDispIns` for Wasm. Co-authored-by: Adam Perlin <adamperlin@microsoft.com>
1 parent bb1148d commit 03e2e80

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/coreclr/jit/emitwasm.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,16 @@ void emitter::emitDispIns(
11161116

11171117
case IF_CODE_SIZE:
11181118
{
1119-
FuncInfoDsc* const func = m_compiler->funGetFunc(emitCurIG->igFuncIdx);
1119+
// We should either have a non-null ig parameter, or emitCurIG should be set
1120+
insGroup* curIG = ig;
1121+
if (curIG == nullptr)
1122+
{
1123+
curIG = emitCurIG;
1124+
}
1125+
assert(curIG != nullptr);
1126+
1127+
FuncInfoDsc* const func = m_compiler->funGetFunc(curIG->igFuncIdx);
1128+
assert(func != nullptr);
11201129

11211130
emitLocation* const startLoc = func->startLoc;
11221131
emitLocation* const endLoc = func->endLoc;

0 commit comments

Comments
 (0)