Skip to content
New issue

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

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

Already on GitHub? Sign in 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 all 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
8 changes: 7 additions & 1 deletion src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,15 @@ void Compiler::eeSetLVdone()
eeDispVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
}
#endif // DEBUG
if ((eeVarsCount == 0) && (eeVars != nullptr))
{
// We still call setVars with nullptr when eeVarsCount is 0 as part of the contract.
// We also need to free the nonused memory.
info.compCompHnd->freeArray(eeVars);
eeVars = nullptr;
}

info.compCompHnd->setVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);

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

Expand Down