Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
18c2aa25
Commit
18c2aa25
authored
Aug 07, 2000
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ if USE_STACKCHECK is defined, use PyOS_CheckStack to look
for excessive recursion.
parent
aa39a7ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Modules/_sre.c
Modules/_sre.c
+7
-0
No files found.
Modules/_sre.c
View file @
18c2aa25
...
...
@@ -58,7 +58,9 @@ char copyright[] = " SRE 0.9.8 Copyright (c) 1997-2000 by Secret Labs AB ";
/* optional features */
/* prevent run-away recursion (bad patterns on long strings) */
#if !defined(USE_STACKCHECK)
#define USE_RECURSION_LIMIT 10000
#endif
/* enables fast searching */
#define USE_FAST_SEARCH
...
...
@@ -527,6 +529,11 @@ SRE_MATCH(SRE_STATE* state, SRE_CODE* pattern, int level)
TRACE
((
"%8d: enter %d
\n
"
,
PTR
(
ptr
),
level
));
#if defined(USE_STACKCHECK)
if
(
level
%
10
==
0
&&
PyOS_CheckStack
())
{
return
SRE_ERROR_RECURSION_LIMIT
;
#endif
#if defined(USE_RECURSION_LIMIT)
if
(
level
>
USE_RECURSION_LIMIT
)
return
SRE_ERROR_RECURSION_LIMIT
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment