Staging
v0.5.1
https://github.com/python/cpython
Revision 961703cdc82536b6ff897ad7d4b3bbf22718d1b5 authored by Miss Islington (bot) on 16 July 2020, 13:25:31 UTC, committed by GitHub on 16 July 2020, 13:25:31 UTC

GCC says
```
../cpython/Parser/string_parser.c: In function ‘fstring_find_expr’:
../cpython/Parser/string_parser.c:404:93: warning: ‘cols’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  404 |     p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? t->col_offset + cols : cols;
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../cpython/Parser/string_parser.c:384:16: note: ‘cols’ was declared here
  384 |     int lines, cols;
      |                ^~~~
../cpython/Parser/string_parser.c:403:45: warning: ‘lines’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  403 |     p2->starting_lineno = t->lineno + lines - 1;
      |                           ~~~~~~~~~~~~~~~~~~^~~
../cpython/Parser/string_parser.c:384:9: note: ‘lines’ was declared here
  384 |     int lines, cols;
      |         ^~~~~
```

and, indeed, if `PyBytes_AsString` somehow fails, lines & cols will not be initialized.
(cherry picked from commit 2ad7e9c011b7606c5c7307176df07419a0e60134)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent f0f6566
History
Tip revision: 961703cdc82536b6ff897ad7d4b3bbf22718d1b5 authored by Miss Islington (bot) on 16 July 2020, 13:25:31 UTC
Fix possibly-unitialized warning in string_parser.c. (GH-21503)
Tip revision: 961703c
File Mode Size
_asyncio.vcxproj -rw-r--r-- 4.2 KB
_asyncio.vcxproj.filters -rw-r--r-- 713 bytes
_bz2.vcxproj -rw-r--r-- 5.1 KB
_bz2.vcxproj.filters -rw-r--r-- 2.1 KB
_ctypes.vcxproj -rw-r--r-- 4.9 KB
_ctypes.vcxproj.filters -rw-r--r-- 1.6 KB
_ctypes_test.vcxproj -rw-r--r-- 4.3 KB
_ctypes_test.vcxproj.filters -rw-r--r-- 993 bytes
_decimal.vcxproj -rw-r--r-- 7.5 KB
_decimal.vcxproj.filters -rw-r--r-- 5.0 KB
_elementtree.vcxproj -rw-r--r-- 5.6 KB
_elementtree.vcxproj.filters -rw-r--r-- 3.1 KB
_freeze_importlib.vcxproj -rw-r--r-- 7.2 KB
_freeze_importlib.vcxproj.filters -rw-r--r-- 974 bytes
_hashlib.vcxproj -rw-r--r-- 4.4 KB
_hashlib.vcxproj.filters -rw-r--r-- 711 bytes
_lzma.vcxproj -rw-r--r-- 4.9 KB
_lzma.vcxproj.filters -rw-r--r-- 710 bytes
_msi.vcxproj -rw-r--r-- 4.4 KB
_msi.vcxproj.filters -rw-r--r-- 698 bytes
_multiprocessing.vcxproj -rw-r--r-- 4.6 KB
_multiprocessing.vcxproj.filters -rw-r--r-- 1.1 KB
_overlapped.vcxproj -rw-r--r-- 4.4 KB
_overlapped.vcxproj.filters -rw-r--r-- 709 bytes
_queue.vcxproj -rw-r--r-- 4.2 KB
_queue.vcxproj.filters -rw-r--r-- 711 bytes
_socket.vcxproj -rw-r--r-- 4.5 KB
_socket.vcxproj.filters -rw-r--r-- 977 bytes
_sqlite3.vcxproj -rw-r--r-- 5.7 KB
_sqlite3.vcxproj.filters -rw-r--r-- 2.7 KB
_ssl.vcxproj -rw-r--r-- 4.8 KB
_ssl.vcxproj.filters -rw-r--r-- 813 bytes
_testbuffer.vcxproj -rw-r--r-- 4.2 KB
_testbuffer.vcxproj.filters -rw-r--r-- 710 bytes
_testcapi.vcxproj -rw-r--r-- 4.3 KB
_testcapi.vcxproj.filters -rw-r--r-- 714 bytes
_testconsole.vcxproj -rw-r--r-- 4.4 KB
_testconsole.vcxproj.filters -rw-r--r-- 897 bytes
_testembed.vcxproj -rw-r--r-- 4.3 KB
_testembed.vcxproj.filters -rw-r--r-- 901 bytes
_testimportmultiple.vcxproj -rw-r--r-- 4.3 KB
_testimportmultiple.vcxproj.filters -rw-r--r-- 718 bytes
_testinternalcapi.vcxproj -rw-r--r-- 4.3 KB
_testinternalcapi.vcxproj.filters -rw-r--r-- 716 bytes
_testmultiphase.vcxproj -rw-r--r-- 4.4 KB
_testmultiphase.vcxproj.filters -rw-r--r-- 905 bytes
_tkinter.vcxproj -rw-r--r-- 5.7 KB
_tkinter.vcxproj.filters -rw-r--r-- 809 bytes
_uuid.vcxproj -rw-r--r-- 4.4 KB
_uuid.vcxproj.filters -rw-r--r-- 783 bytes
_zoneinfo.vcxproj -rw-r--r-- 4.2 KB
_zoneinfo.vcxproj.filters -rw-r--r-- 708 bytes
build.bat -rw-r--r-- 7.1 KB
build_env.bat -rw-r--r-- 25 bytes
clean.bat -rw-r--r-- 128 bytes
env.bat -rw-r--r-- 712 bytes
field3.py -rw-r--r-- 974 bytes
find_msbuild.bat -rw-r--r-- 2.8 KB
find_python.bat -rw-r--r-- 3.2 KB
fix_encoding.py -rwxr-xr-x 952 bytes
get_external.py -rwxr-xr-x 1.8 KB
get_externals.bat -rw-r--r-- 4.3 KB
idle.bat -rw-r--r-- 296 bytes
lib.pyproj -rw-r--r-- 90.2 KB
libffi.props -rw-r--r-- 1.0 KB
liblzma.vcxproj -rw-r--r-- 14.2 KB
liblzma.vcxproj.filters -rw-r--r-- 17.2 KB
openssl.props -rw-r--r-- 1.5 KB
openssl.vcxproj -rw-r--r-- 5.7 KB
pcbuild.proj -rw-r--r-- 6.1 KB
pcbuild.sln -rw-r--r-- 115.6 KB
prepare_libffi.bat -rw-r--r-- 6.7 KB
prepare_ssl.bat -rw-r--r-- 2.1 KB
prepare_ssl.py -rwxr-xr-x 6.7 KB
prepare_tcltk.bat -rw-r--r-- 1.9 KB
pyexpat.vcxproj -rw-r--r-- 4.8 KB
pyexpat.vcxproj.filters -rw-r--r-- 1.4 KB
pylauncher.vcxproj -rw-r--r-- 4.4 KB
pylauncher.vcxproj.filters -rw-r--r-- 1013 bytes
pyproject.props -rw-r--r-- 13.3 KB
pyshellext.vcxproj -rw-r--r-- 4.6 KB
pyshellext.vcxproj.filters -rw-r--r-- 1.2 KB
python.props -rw-r--r-- 14.6 KB
python.vcxproj -rw-r--r-- 7.2 KB
python.vcxproj.filters -rw-r--r-- 824 bytes
python3dll.vcxproj -rw-r--r-- 7.9 KB
python3dll.vcxproj.filters -rw-r--r-- 998 bytes
python_uwp.vcxproj -rw-r--r-- 5.0 KB
python_uwp.vcxproj.filters -rw-r--r-- 823 bytes
pythoncore.vcxproj -rw-r--r-- 28.4 KB
pythoncore.vcxproj.filters -rw-r--r-- 41.9 KB
pythonw.vcxproj -rw-r--r-- 4.2 KB
pythonw.vcxproj.filters -rw-r--r-- 703 bytes
pythonw_uwp.vcxproj -rw-r--r-- 5.0 KB
pythonw_uwp.vcxproj.filters -rw-r--r-- 825 bytes
pywlauncher.vcxproj -rw-r--r-- 4.4 KB
pywlauncher.vcxproj.filters -rw-r--r-- 1013 bytes
readme.txt -rw-r--r-- 11.0 KB
regen.vcxproj -rw-r--r-- 12.1 KB
rmpyc.py -rw-r--r-- 409 bytes
rt.bat -rw-r--r-- 2.1 KB
select.vcxproj -rw-r--r-- 4.3 KB
select.vcxproj.filters -rw-r--r-- 711 bytes
sqlite3.vcxproj -rw-r--r-- 5.3 KB
sqlite3.vcxproj.filters -rw-r--r-- 1.1 KB
tcl.vcxproj -rw-r--r-- 3.0 KB
tcltk.props -rw-r--r-- 3.7 KB
tix.vcxproj -rw-r--r-- 3.9 KB
tk.vcxproj -rw-r--r-- 3.2 KB
unicodedata.vcxproj -rw-r--r-- 4.4 KB
unicodedata.vcxproj.filters -rw-r--r-- 1.1 KB
urlretrieve.py -rw-r--r-- 1.2 KB
venvlauncher.vcxproj -rw-r--r-- 4.6 KB
venvlauncher.vcxproj.filters -rw-r--r-- 822 bytes
venvwlauncher.vcxproj -rw-r--r-- 4.6 KB
venvwlauncher.vcxproj.filters -rw-r--r-- 822 bytes
winsound.vcxproj -rw-r--r-- 4.4 KB
winsound.vcxproj.filters -rw-r--r-- 775 bytes
xxlimited.vcxproj -rw-r--r-- 4.4 KB
xxlimited.vcxproj.filters -rw-r--r-- 433 bytes

readme.txt

back to top