Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • xcbproto xcbproto
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 16
    • Issues 16
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • proto
  • xcbprotoxcbproto
  • Merge requests
  • !6

Fix size computation of imported lists

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Uli Schlachter requested to merge psychon/xcbproto:incorrect-size into master Dec 01, 2019
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

XFixes contains a CreateRegion request:

This request contains a list of type RECTANGLE. This struct comes from xproto and is thus not contained in xfixes itself.

Normal "Struct"s have their resolve() method called early, because they appear in the module itself. However, in the CreateRegion case, this struct is imported and thus does not get resolved. Instead, ListType's resolve() method calls self.member.resolve(module). Thus, only at this point is the struct resolved.

Why is this important? Struct.resolve() is the same as ComplexType.resolve() and this function does self.calc_size() at the end. Thus, only after the struct was resolved is its size known. Before that, the size is just set to 0 (this happens in ComplexType.init).

However, ListType.init already computes its size member based on its member. At this point, this is still 0 so the list ends up believing its size to be zero.

Fix this by recomputing self.size in ListType.resolve().

Signed-off-by: Uli Schlachter psychon@znc.in

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: incorrect-size