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
869bacd4
Commit
869bacd4
authored
Apr 13, 2006
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert - breaks build of Python/ast.c w/ gcc
parent
b9406711
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
Include/asdl.h
Include/asdl.h
+3
-7
Python/compile.c
Python/compile.c
+5
-2
No files found.
Include/asdl.h
View file @
869bacd4
...
...
@@ -19,22 +19,18 @@ typedef enum {false, true} bool;
typedef
struct
{
int
size
;
union
{
void
*
elements
[
1
];
unsigned
int
enum_type
[
1
];
}
elt
;
}
asdl_seq
;
asdl_seq
*
asdl_seq_new
(
int
size
,
PyArena
*
arena
);
#define asdl_seq_GET(S, I) (S)->elt.elements[(I)]
#define asdl_seq_GET_ENUM(S, I) (S)->elt.enum_type[(I)]
#define asdl_seq_GET(S, I) (S)->elements[(I)]
#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
#ifdef Py_DEBUG
#define asdl_seq_SET(S, I, V) { \
int _asdl_i = (I); \
assert((S) && _asdl_i < (S)->size); \
(S)->el
t.el
ements[_asdl_i] = (V); \
(S)->elements[_asdl_i] = (V); \
}
#else
#define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
...
...
Python/compile.c
View file @
869bacd4
...
...
@@ -3066,8 +3066,10 @@ compiler_compare(struct compiler *c, expr_ty e)
for
(
i
=
1
;
i
<
n
;
i
++
)
{
ADDOP
(
c
,
DUP_TOP
);
ADDOP
(
c
,
ROT_THREE
);
/* XXX We're casting a void* to cmpop_ty in the next stmt. */
ADDOP_I
(
c
,
COMPARE_OP
,
cmpop
((
cmpop_ty
)
asdl_seq_GET_ENUM
(
e
->
v
.
Compare
.
ops
,
i
-
1
)));
cmpop
((
cmpop_ty
)(
CMPCAST
asdl_seq_GET
(
e
->
v
.
Compare
.
ops
,
i
-
1
))));
ADDOP_JREL
(
c
,
JUMP_IF_FALSE
,
cleanup
);
NEXT_BLOCK
(
c
);
ADDOP
(
c
,
POP_TOP
);
...
...
@@ -3078,7 +3080,8 @@ compiler_compare(struct compiler *c, expr_ty e)
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
e
->
v
.
Compare
.
comparators
,
n
-
1
));
ADDOP_I
(
c
,
COMPARE_OP
,
/* XXX We're casting a void* to cmpop_ty in the next stmt. */
cmpop
((
cmpop_ty
)
asdl_seq_GET_ENUM
(
e
->
v
.
Compare
.
ops
,
n
-
1
)));
cmpop
((
cmpop_ty
)(
CMPCAST
asdl_seq_GET
(
e
->
v
.
Compare
.
ops
,
n
-
1
))));
if
(
n
>
1
)
{
basicblock
*
end
=
compiler_new_block
(
c
);
if
(
end
==
NULL
)
...
...
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