Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 395
    • Issues 395
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 27
    • Merge requests 27
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !189

filter out invalid function ERCs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Hans-Nikolai Viessmann requested to merge hans/sac2c:emrl-race-condition into develop Mar 24, 2022
  • Overview 10
  • Commits 1
  • Changes 3

Through LivermoreLoop issue https://github.com/SacBase/LivermoreLoops/issues/5, it was discovered that EMRL can cause a race condition. Specifically, by design EMRL must find a suitable matching avis to use as part of a buffer-swap otherwise it will not cause a memory lift. In specific situations, the chosen candidate is not suitable as it has later references. For example:

a = alloc()
emr_lift = alloc ()
x = loop (a, emr_lift)
print (x)
free (x)
print (a)
free (a)

here a is referenced both by the loop and a call to print. The return value x can in this situation be an alias to either a or emr_lift depending on the return criteria of the loop. In the first case the second free errors out as a, via x, has already been freed. The latter case does not display this problem.

This MR extends FRC (filter reuse candidates) to additionally check function ERCs, thereby resolving the above example, e.g. emr_lift would never materialize as a is referenced twice in the body.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: emrl-race-condition