microsoft / microsoft/CLRInstrumentationEngine

Improve type safety of internal classes

Open
#311 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
102
Forks
52
Avg merge
13h 11m
Merged PRs (30d)
6

Description

There are a number of places where we cast from a base class to a derived class in our internal code, which could cause problems if a caller passes us an instance of an interface that we did not create internally. I suggest we:

  1. Update our code to use virtual inheritance (instead of multiple inheritance). This will help us catch locations where we cast from a base class.

  2. QI for the derived class. This will give us type safety.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inventorying the internal classes and base-to-derived casts affected by the issue, then trace where those objects enter the instrumentation engine. Compare the current inheritance and interface patterns with the proposed virtual inheritance and derived-class QI approach; done means the relevant unsafe casts have been addressed and the affected paths remain compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.