File tree 3 files changed +45
-1
lines changed
3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -1363,7 +1363,50 @@ def test_pdb_issue_43318():
1363
1363
4
1364
1364
"""
1365
1365
1366
+ def test_pdb_issue_gh_91742 ():
1367
+ """See GH-91742
1366
1368
1369
+ >>> def test_function():
1370
+ ... __author__ = "pi"
1371
+ ... __version__ = "3.14"
1372
+ ...
1373
+ ... def about():
1374
+ ... '''About'''
1375
+ ... print(f"Author: {__author__!r}",
1376
+ ... f"Version: {__version__!r}",
1377
+ ... sep=" ")
1378
+ ...
1379
+ ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
1380
+ ... about()
1381
+
1382
+
1383
+ >>> reset_Breakpoint()
1384
+ >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
1385
+ ... 'step',
1386
+ ... 'next',
1387
+ ... 'next',
1388
+ ... 'jump 5',
1389
+ ... 'continue'
1390
+ ... ]):
1391
+ ... test_function()
1392
+ > <doctest test.test_pdb.test_pdb_issue_gh_91742[0]>(12)test_function()
1393
+ -> about()
1394
+ (Pdb) step
1395
+ --Call--
1396
+ > <doctest test.test_pdb.test_pdb_issue_gh_91742[0]>(5)about()
1397
+ -> def about():
1398
+ (Pdb) next
1399
+ > <doctest test.test_pdb.test_pdb_issue_gh_91742[0]>(7)about()
1400
+ -> print(f"Author: {__author__!r}",
1401
+ (Pdb) next
1402
+ > <doctest test.test_pdb.test_pdb_issue_gh_91742[0]>(8)about()
1403
+ -> f"Version: {__version__!r}",
1404
+ (Pdb) jump 5
1405
+ > <doctest test.test_pdb.test_pdb_issue_gh_91742[0]>(5)about()
1406
+ -> def about():
1407
+ (Pdb) continue
1408
+ Author: 'pi' Version: '3.14'
1409
+ """
1367
1410
@support .requires_subprocess ()
1368
1411
class PdbTestCase (unittest .TestCase ):
1369
1412
def tearDown (self ):
Original file line number Diff line number Diff line change
1
+ Fix :mod: `pdb ` crash after jump caused by a null pointer dereference. Patch by Kumar Aditya.
Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ static void
418
418
frame_stack_pop (PyFrameObject * f )
419
419
{
420
420
PyObject * v = _PyFrame_StackPop (f -> f_frame );
421
- Py_DECREF (v );
421
+ Py_XDECREF (v );
422
422
}
423
423
424
424
static PyFrameState
You can’t perform that action at this time.
0 commit comments