[Python-checkins] python/dist/src/Python ast.c,1.1.2.51,1.1.2.52
jhylton at users.sourceforge.net
jhylton at users.sourceforge.net
Fri Apr 23 11:27:55 EDT 2004
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv571
Modified Files:
Tag: ast-branch
ast.c
Log Message:
Fix line number assignments for if/elif/else.
The old code was using the line number of the original if for every
elif, which was wrong and caused the lnotab to be corrupted.
Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.51
retrieving revision 1.1.2.52
diff -C2 -d -r1.1.2.51 -r1.1.2.52
*** ast.c 23 Apr 2004 04:31:22 -0000 1.1.2.51
--- ast.c 23 Apr 2004 15:27:53 -0000 1.1.2.52
***************
*** 1924,1928 ****
expr_ty expression;
asdl_seq *seq1, *seq2;
!
orelse = asdl_seq_new(1);
if (!orelse)
--- 1924,1928 ----
expr_ty expression;
asdl_seq *seq1, *seq2;
!
orelse = asdl_seq_new(1);
if (!orelse)
***************
*** 1944,1948 ****
}
! asdl_seq_SET(orelse, 0, If(expression, seq1, seq2, LINENO(n)));
/* the just-created orelse handled the last elif */
n_elif--;
--- 1944,1949 ----
}
! asdl_seq_SET(orelse, 0, If(expression, seq1, seq2,
! LINENO(CHILD(n, NCH(n) - 6))));
/* the just-created orelse handled the last elif */
n_elif--;
***************
*** 1970,1974 ****
asdl_seq_SET(new, 0,
! If(expression, suite_seq, orelse, LINENO(n)));
orelse = new;
}
--- 1971,1976 ----
asdl_seq_SET(new, 0,
! If(expression, suite_seq, orelse,
! LINENO(CHILD(n, off))));
orelse = new;
}
More information about the Python-checkins
mailing list