Skip to content

The cases_generator handles some instructions incorrectly #106250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brandtbucher opened this issue Jun 29, 2023 · 0 comments
Closed

The cases_generator handles some instructions incorrectly #106250

brandtbucher opened this issue Jun 29, 2023 · 0 comments
Assignees
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@brandtbucher
Copy link
Member

brandtbucher commented Jun 29, 2023

I triggered this assert...

Traceback (most recent call last):
  File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1609, in <module>
    main()
  File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1604, in main
    a.write_metadata()
  File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1260, in write_metadata
    assert not instr.active_caches, (instr.name, instr.cache_effects)
AssertionError: ('TO_BOOL_ALWAYS_TRUE', [CacheEffect(context=<Python/bytecodes.c: 1807-1810>, name='unused', size=1), CacheEffect(context=<Python/bytecodes.c: 1811-1814>, name='version', size=2)]

...while defining this new instruction...

        inst(TO_BOOL_ALWAYS_TRUE, (unused/1, version/2, value -- res)) {
            // This one is a bit weird, because we expect *some* failures:
            assert(version);
            DEOPT_IF(Py_TYPE(value)->tp_version_tag != version, TO_BOOL);
            STAT_INC(TO_BOOL, hit);
            DECREF_INPUTS();
            res = Py_True;
        }

@gvanrossum thinks that the assert is incorrect: it appears that the current code doesn't know how to handle an instruction that uses caches but doesn't have an oparg.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants