Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid reporting empty debug info ranges to the vm #77289

Merged
merged 16 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6959,8 +6959,11 @@ void CodeGen::genSetScopeInfoUsingVariableRanges()
end++;
}

genSetScopeInfo(liveRangeIndex, start, end - start, varNum, varNum, true, loc);
liveRangeIndex++;
if (start < end)
{
genSetScopeInfo(liveRangeIndex, start, end - start, varNum, varNum, true, loc);
liveRangeIndex++;
}
};

siVarLoc* curLoc = nullptr;
Expand Down
10 changes: 8 additions & 2 deletions src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,14 @@ void Compiler::eeSetLVdone()
eeDispVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
}
#endif // DEBUG

info.compCompHnd->setVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
if (0 < eeVarsCount)
{
info.compCompHnd->setVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
}
else if (eeVars != nullptr)
{
info.compCompHnd->freeArray(eeVars);
}

eeVars = nullptr; // We give up ownership after setVars()
}
Expand Down