Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,774
    • Issues 2,774
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 942
    • Merge requests 942
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mesa
  • mesamesa
  • Merge requests
  • !14119

panfrost: Make pan_merge macro more robust

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alyssa Rosenzweig requested to merge alyssa/mesa:merge into main Dec 08, 2021
  • Overview 1
  • Commits 1
  • Pipelines 4
  • Changes 1

Consider the following innocuous-looking code:

pan_merge(packed, vtx->attributes[i], ATTRIBUTE);

Under the current implementation, this code is completely broken. Why? The current implemention is a macro which hardcodes the loop index i, which shadows the i used to index attributes. Pull out a helper method so we do the right thing without resulting to further preprocessor abuse (COUNTER).

While making things more robust, assert the crucial pan_merge invariant that the total size is a multiple of 4; if this fails, the routine risks memory corruption.

Signed-off-by: Alyssa Rosenzweig alyssa@collabora.com

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: merge