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
842f3539
Commit
842f3539
authored
Jul 30, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some asserts and update comments
parent
a5535100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Python/ast.c
Python/ast.c
+3
-2
Python/compile.c
Python/compile.c
+1
-0
No files found.
Python/ast.c
View file @
842f3539
...
...
@@ -622,10 +622,10 @@ ast_for_arguments(struct compiling *c, const node *n)
}
args
=
(
n_args
?
asdl_seq_new
(
n_args
,
c
->
c_arena
)
:
NULL
);
if
(
!
args
&&
n_args
)
return
NULL
;
/* Don't need to go
to NULL; nothing
allocated */
return
NULL
;
/* Don't need to go
to error; no objects
allocated */
defaults
=
(
n_defaults
?
asdl_seq_new
(
n_defaults
,
c
->
c_arena
)
:
NULL
);
if
(
!
defaults
&&
n_defaults
)
goto
error
;
return
NULL
;
/* Don't need to goto error; no objects allocated */
/* fpdef: NAME | '(' fplist ')'
fplist: fpdef (',' fpdef)* [',']
...
...
@@ -644,6 +644,7 @@ ast_for_arguments(struct compiling *c, const node *n)
expr_ty
expression
=
ast_for_expr
(
c
,
CHILD
(
n
,
i
+
2
));
if
(
!
expression
)
goto
error
;
assert
(
defaults
!=
NULL
);
asdl_seq_SET
(
defaults
,
j
++
,
expression
);
i
+=
2
;
found_default
=
1
;
...
...
Python/compile.c
View file @
842f3539
...
...
@@ -3031,6 +3031,7 @@ compiler_boolop(struct compiler *c, expr_ty e)
return
0
;
s
=
e
->
v
.
BoolOp
.
values
;
n
=
asdl_seq_LEN
(
s
)
-
1
;
assert
(
n
>=
0
);
for
(
i
=
0
;
i
<
n
;
++
i
)
{
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
s
,
i
));
ADDOP_JREL
(
c
,
jumpi
,
end
);
...
...
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