Skip to content

LocalStateTracing: hoisted parameter reported to LogParameterStore as parameter instead of field only when entering block #79703

@jcouv

Description

@jcouv

In LocalStateTracingInstrumenter.InstrumentBlock, we report the state of parameters using LogParameterStore.
In that scenario, the parameter is always reported by its ordinal.
We also record parameters with LogParameterStore when it is assigned directly or via method return. But those other scenarios report using a BoundParameterId, which means that we'll either emit the parameter's ordinal or, in the case when the parameter is hoisted, the field's ordinal.
See logic in EmitParameterIdExpression.

This seems inconsistent for consumers of the logged information. We should probably also use a BoundParameterId in the call to LogParameterStore in LocalStateTracingInstrumenter.InstrumentBlock.

Relates to #79557 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions