Skip to content
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

gh-116180: check if globals is NULL and set error in run_eval_code_obj() #116637

Merged
merged 50 commits into from May 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9635b76
check if gobals is null
ngr-ilmarh Mar 12, 2024
3e97671
make NULL check earlier
ngr-ilmarh Mar 12, 2024
348d895
Merge branch 'main' into fix-issue-116180
NGRsoftlab Mar 12, 2024
259034c
PEP-7
ngr-ilmarh Mar 12, 2024
85d9f47
Merge branch 'main' into fix-issue-116180
NGRsoftlab Mar 13, 2024
cf578bd
Merge branch 'main' into fix-issue-116180
NGRsoftlab Mar 14, 2024
bba6927
Merge branch 'main' into fix-issue-116180
NGRsoftlab Mar 20, 2024
1b5fe4c
Squashed commit of the following:
ngr-ilmarh Apr 2, 2024
a016a54
Squashed commit of the following:
ngr-ilmarh Apr 2, 2024
173b9ce
Merge branch 'fix-issue-116180' of https://github.com/NGRsoftlab/cpyt…
ngr-ilmarh Apr 2, 2024
86c6e57
Merge branch 'main' into fix-issue-116180
ngr-ilmarh Apr 2, 2024
7503772
change if null to assert
ngr-ilmarh Apr 2, 2024
f175046
Revert "change if null to assert"
ngr-ilmarh Apr 2, 2024
dcab696
bring back error message instead of assert
ngr-ilmarh Apr 2, 2024
9532797
return error instead of segfault and test it
ngr-ilmarh Apr 5, 2024
ee0fd8a
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 5, 2024
7eca26f
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 5, 2024
08b5c3a
Update Python/pythonrun.c
NGRsoftlab Apr 5, 2024
23b9fe6
Update Modules/_testcapi/pyrun.c
NGRsoftlab Apr 5, 2024
acc7eb3
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 5, 2024
09c71a9
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 8, 2024
806d21c
refactor unittests through helper
ngr-ilmarh Apr 8, 2024
907c86d
fix closeit test when expect exception global == NULL
ngr-ilmarh Apr 8, 2024
af9e9fc
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 9, 2024
56f0d3c
refactor python test, add some error handling to module init
ngr-ilmarh Apr 9, 2024
b1d7ab2
fix lost bracket
ngr-ilmarh Apr 9, 2024
f8e29ce
cleanup (and rename)
ngr-ilmarh Apr 9, 2024
efe064d
make windows build tests
ngr-ilmarh Apr 9, 2024
8f33e7a
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 10, 2024
296705a
next round of refactoring
ngr-ilmarh Apr 10, 2024
cd58eb6
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 11, 2024
c461bd9
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 12, 2024
7db13d0
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 15, 2024
eef557c
Globals must be dict. Fix filename encoding and file closing in the w…
serhiy-storchaka Apr 15, 2024
66646e9
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 15, 2024
45cab7f
Skip tests with undecodable filename if not supported.
serhiy-storchaka Apr 15, 2024
1716ac6
Add a test for PyRun_StringFlags(). Test globals at the lower level.
serhiy-storchaka Apr 16, 2024
1a9532c
Pass filename as bytes.
serhiy-storchaka Apr 16, 2024
6f0a0a4
Merge branch 'main' into fix-issue-116180
NGRsoftlab Apr 17, 2024
2607806
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 17, 2024
7f4c496
Merge branch 'main' into fix-issue-116180
NGRsoftlab Apr 17, 2024
5974757
Merge branch 'python:main' into fix-issue-116180
NGRsoftlab Apr 17, 2024
2b4ba12
Update Lib/test/test_capi/test_pyrun.py
serhiy-storchaka Apr 17, 2024
aa73f40
Merge branch 'fix-issue-116180' of https://github.com/NGRsoftlab/cpyt…
ngr-ilmarh Apr 27, 2024
f6a8ee9
stashed changes
ngr-ilmarh Apr 27, 2024
ccf5871
remove renamed files
ngr-ilmarh Apr 27, 2024
abeea0a
Enable tests for NULL and non-dict globals.
serhiy-storchaka Apr 28, 2024
d579f21
Add tests for a dict subclass.
serhiy-storchaka Apr 28, 2024
d3938f5
Merge branch 'main' into fix-issue-116180
NGRsoftlab May 2, 2024
4a18dd2
Merge branch 'main' into fix-issue-116180
NGRsoftlab May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Python/pythonrun.c
Expand Up @@ -1288,6 +1288,11 @@ run_eval_code_obj(PyThreadState *tstate, PyCodeObject *co, PyObject *globals, Py
}
}

if (globals == NULL) {
PyErr_SetString(PyExc_RuntimeError, "globals are NULL");
return NULL;
}
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved

v = PyEval_EvalCode((PyObject*)co, globals, locals);
if (!v && _PyErr_Occurred(tstate) == PyExc_KeyboardInterrupt) {
_PyRuntime.signals.unhandled_keyboard_interrupt = 1;
Expand Down