Skip to content

ApplyView::read() doesn't go through the apply-state-table cache like peek() does #8068

Description

@mvadari

ApplyViewBase::read() (ApplyViewBase.cpp:61) calls items_.read(), not items_.peek(). peek() installs the view's own cached copy of an SLE; read() does not. So a read() and a peek() for the same key on the same ApplyView can return two different SLE objects — if code modifies the one from peek(), the one returned earlier by read() goes stale.

Found while reviewing PR #7886, which works around this in SLEBase's resolveEntry() helper by routing read-only lookups through peek() via a dynamic_cast<ApplyView*> check instead of calling read() directly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions