@@ -4089,10 +4089,6 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type,
40894089 is_async_generator = c -> u -> u_ste -> ste_coroutine ;
40904090
40914091 if (is_async_generator && !is_async_function && type != COMP_GENEXP ) {
4092- if (e -> lineno > c -> u -> u_lineno ) {
4093- c -> u -> u_lineno = e -> lineno ;
4094- c -> u -> u_lineno_set = 0 ;
4095- }
40964092 compiler_error (c , "asynchronous comprehension outside of "
40974093 "an asynchronous function" );
40984094 goto error_in_scope ;
@@ -4430,17 +4426,8 @@ compiler_with(struct compiler *c, stmt_ty s, int pos)
44304426}
44314427
44324428static int
4433- compiler_visit_expr (struct compiler * c , expr_ty e )
4429+ compiler_visit_expr1 (struct compiler * c , expr_ty e )
44344430{
4435- /* If expr e has a different line number than the last expr/stmt,
4436- set a new line number for the next instruction.
4437- */
4438- if (e -> lineno > c -> u -> u_lineno ) {
4439- c -> u -> u_lineno = e -> lineno ;
4440- c -> u -> u_lineno_set = 0 ;
4441- }
4442- /* Updating the column offset is always harmless. */
4443- c -> u -> u_col_offset = e -> col_offset ;
44444431 switch (e -> kind ) {
44454432 case BoolOp_kind :
44464433 return compiler_boolop (c , e );
@@ -4609,6 +4596,31 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
46094596 return 1 ;
46104597}
46114598
4599+ static int
4600+ compiler_visit_expr (struct compiler * c , expr_ty e )
4601+ {
4602+ /* If expr e has a different line number than the last expr/stmt,
4603+ set a new line number for the next instruction.
4604+ */
4605+ int old_lineno = c -> u -> u_lineno ;
4606+ int old_col_offset = c -> u -> u_col_offset ;
4607+ if (e -> lineno != c -> u -> u_lineno ) {
4608+ c -> u -> u_lineno = e -> lineno ;
4609+ c -> u -> u_lineno_set = 0 ;
4610+ }
4611+ /* Updating the column offset is always harmless. */
4612+ c -> u -> u_col_offset = e -> col_offset ;
4613+
4614+ int res = compiler_visit_expr1 (c , e );
4615+
4616+ if (old_lineno != c -> u -> u_lineno ) {
4617+ c -> u -> u_lineno = old_lineno ;
4618+ c -> u -> u_lineno_set = 0 ;
4619+ }
4620+ c -> u -> u_col_offset = old_col_offset ;
4621+ return res ;
4622+ }
4623+
46124624static int
46134625compiler_augassign (struct compiler * c , stmt_ty s )
46144626{
0 commit comments