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
a38993b5
Commit
a38993b5
authored
Feb 09, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF patch 103589: Fix handling of cell vars that are either * or ** parameters.
(Nick Mathewson) Remove to XXX comments
parent
e641b20d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
Python/compile.c
Python/compile.c
+15
-8
No files found.
Python/compile.c
View file @
a38993b5
...
@@ -2486,10 +2486,6 @@ com_assert_stmt(struct compiling *c, node *n)
...
@@ -2486,10 +2486,6 @@ com_assert_stmt(struct compiling *c, node *n)
where <message> is the second test, if present.
where <message> is the second test, if present.
*/
*/
/* XXX should __debug__ and AssertionError get inserted into
the symbol table? they don't follow the normal rules
because they are always loaded as globals */
if
(
Py_OptimizeFlag
)
if
(
Py_OptimizeFlag
)
return
;
return
;
com_addop_name
(
c
,
LOAD_GLOBAL
,
"__debug__"
);
com_addop_name
(
c
,
LOAD_GLOBAL
,
"__debug__"
);
...
@@ -3524,10 +3520,6 @@ com_fplist(struct compiling *c, node *n)
...
@@ -3524,10 +3520,6 @@ com_fplist(struct compiling *c, node *n)
}
}
}
}
/* XXX This function could probably be made simpler, because it
doesn't do anything except generate code for complex arguments.
*/
static
void
static
void
com_arglist
(
struct
compiling
*
c
,
node
*
n
)
com_arglist
(
struct
compiling
*
c
,
node
*
n
)
{
{
...
@@ -3579,12 +3571,22 @@ com_arglist(struct compiling *c, node *n)
...
@@ -3579,12 +3571,22 @@ com_arglist(struct compiling *c, node *n)
REQ
(
ch
,
STAR
);
REQ
(
ch
,
STAR
);
ch
=
CHILD
(
n
,
i
+
1
);
ch
=
CHILD
(
n
,
i
+
1
);
if
(
TYPE
(
ch
)
==
NAME
)
{
if
(
TYPE
(
ch
)
==
NAME
)
{
PyObject
*
v
;
i
+=
3
;
i
+=
3
;
v
=
PyDict_GetItemString
(
c
->
c_cellvars
,
STR
(
ch
));
if
(
v
)
{
com_addoparg
(
c
,
LOAD_FAST
,
narg
);
com_addoparg
(
c
,
STORE_DEREF
,
PyInt_AS_LONG
(
v
));
}
}
narg
++
;
}
}
}
}
}
/* Handle **keywords */
/* Handle **keywords */
if
(
i
<
nch
)
{
if
(
i
<
nch
)
{
PyObject
*
v
;
node
*
ch
;
node
*
ch
;
ch
=
CHILD
(
n
,
i
);
ch
=
CHILD
(
n
,
i
);
if
(
TYPE
(
ch
)
!=
DOUBLESTAR
)
{
if
(
TYPE
(
ch
)
!=
DOUBLESTAR
)
{
...
@@ -3596,6 +3598,11 @@ com_arglist(struct compiling *c, node *n)
...
@@ -3596,6 +3598,11 @@ com_arglist(struct compiling *c, node *n)
else
else
ch
=
CHILD
(
n
,
i
+
1
);
ch
=
CHILD
(
n
,
i
+
1
);
REQ
(
ch
,
NAME
);
REQ
(
ch
,
NAME
);
v
=
PyDict_GetItemString
(
c
->
c_cellvars
,
STR
(
ch
));
if
(
v
)
{
com_addoparg
(
c
,
LOAD_FAST
,
narg
);
com_addoparg
(
c
,
STORE_DEREF
,
PyInt_AS_LONG
(
v
));
}
}
}
if
(
complex
)
{
if
(
complex
)
{
/* Generate code for complex arguments only after
/* Generate code for complex arguments only after
...
...
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