Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,18 @@ private bool IsManaged(TargetPointer ip, [NotNullWhen(true)] out CodeBlockHandle
{
IExecutionManager eman = _target.Contracts.ExecutionManager;
TargetCodePointer codePointer = CodePointerUtils.CodePointerFromAddress(ip, _target);
if (eman.GetCodeBlockHandle(codePointer) is CodeBlockHandle cbh && cbh.Address != TargetPointer.Null)
try
{
codeBlockHandle = cbh;
return true;
if (eman.GetCodeBlockHandle(codePointer) is CodeBlockHandle cbh && cbh.Address != TargetPointer.Null)
{
codeBlockHandle = cbh;
return true;
}
}
catch (VirtualReadException)
{
// If we fail to read memory while looking up the code block, the IP is not in managed code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we fail to read memory while looking up the code block, the IP is not in managed code

How can this happen? I do not think we should ever fail to read the memory (unless the data are corrupted or missing - but then we cannot really tell whether the IP is in managed code or not).

// (or the data is corrupted). Treat as not managed and continue the walk.
}
codeBlockHandle = default;
return false;
Expand Down
Loading