Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gjs gjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 107
    • Issues 107
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gjsgjs
  • Merge requests
  • !188

object: Add GObject properties to the correct prototype

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Georges Basile Stavracas Neto requested to merge gbsneto/issue-171 into master Jul 09, 2018
  • Overview 3
  • Commits 1
  • Pipelines 2
  • Changes 2

Whenever successfully resolving a property, GJS is mistakenly setting the property in the prototype of the prototype, instead of just the prototype. When that happens, it ends up breaking any properties of subclasses. Suppose the following scenario:

     GObject
        |________________
        |                |
 GCharsetConverter   Subclass2
        |
    Subclass1

In this scenario, if 'Subclass1' accesses any possible property from GCharsetConverter, GJS resolves that but ends up setting this property in the prototype of the prototype.

If 'Subclass2' then tries to subsequently access that property, the resolving process will accidentally call the wrong getter. This leads to an immediate crash.

Fix that by using the correct object prototype when resolving the properties. A reproducer was added to the test suite in addition to the fix to this problem, as a protective measure.

Fixes #171 (closed)

Edited Jul 09, 2018 by Georges Basile Stavracas Neto
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: gbsneto/issue-171