Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pypy
pypy
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 582
    • Issues 582
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards

This instance will be upgraded to Heptapod 0.19.0rc2 on 2021-01-18 at 11:00 UTC+1 (a few minutes of downtime)

  • PyPy
  • pypypypy
  • Issues
  • #3305

Closed
Open
Opened Sep 21, 2020 by Armin Rigo@arigoOwner

jit.look_inside_iff() is sometimes used dangerously

jit.look_inside_iff() is sometimes used dangerously. For example, in tupleobject.py, in def _unroll_condition and def _unroll_condition_cmp, it always returns True if the W_TupleObject is a virtual, irrespective of whether the items list is actually a virtual or not. This makes code like this unroll n times, for any value of n:

n = 100
LST1 = [i*i for i in range(n)]
LST2 = [i*i for i in range(n)]

def f():
    return tuple(LST1) == tuple(LST2)

while True:
    f()

The reason is that _compare_tuples unrolls, because the two W_TupleObject involved are virtuals, but the actual lists of items are not.

Edited Sep 21, 2020 by Armin Rigo
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: pypy/pypy#3305