@@ -1498,7 +1498,6 @@ static void emit_atom(JSParseState *s, JSAtom name)
14981498static void emit_column (JSParseState * s , int column_num ) {
14991499 emit_u8 (s , OP_column_num );
15001500 emit_u32 (s , column_num );
1501- // printf("line: %d, column: %d\n", s->line_num, column_num);
15021501}
15031502
15041503static int update_label (JSFunctionDef * s , int label , int delta )
@@ -4720,8 +4719,6 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
47204719 if (js_parse_expect (s , ',' ))
47214720 return -1 ;
47224721 }
4723-
4724- emit_column (s , column_num );
47254722
47264723 if (s -> token .val == TOK_ELLIPSIS ) {
47274724 emit_op (s , OP_array_from );
@@ -4824,6 +4821,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
48244821 break ;
48254822 }
48264823 } else {
4824+ emit_column (s , column_num );
48274825 if (next_token (s ))
48284826 return -1 ;
48294827 emit_func_call :
@@ -9554,7 +9552,7 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
95549552 len = opcode_info [op ].size ;
95559553 pos_next = pos + len ;
95569554 }
9557-
9555+
95589556 s -> column_number_size ++ ;
95599557 goto no_change ;
95609558 case OP_eval : /* convert scope index to adjusted variable index */
@@ -10265,16 +10263,20 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s)
1026510263 case OP_call_method :
1026610264 {
1026710265 /* detect and transform tail calls */
10268- int argc ;
10269- argc = get_u16 (bc_buf + pos + 1 );
10266+ int argc = get_u16 (bc_buf + pos + 1 );
10267+ s -> column_number_size ++ ;
10268+
1027010269 if (code_match (& cc , pos_next , OP_return , -1 )) {
1027110270 if (cc .line_num >= 0 ) line_num = cc .line_num ;
1027210271 add_pc2line_info (s , bc_out .size , line_num );
10272+ add_pc2col_info (s , bc_out .size , column_num );
1027310273 put_short_code (& bc_out , op + 1 , argc );
1027410274 pos_next = skip_dead_code (s , bc_buf , bc_len , cc .pos , & line_num );
1027510275 break ;
1027610276 }
10277+
1027710278 add_pc2line_info (s , bc_out .size , line_num );
10279+ add_pc2col_info (s , bc_out .size , column_num );
1027810280 put_short_code (& bc_out , op , argc );
1027910281 break ;
1028010282 }
@@ -10954,6 +10956,11 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s)
1095410956 if (s -> line_number_slots [j ].pc > pos )
1095510957 s -> line_number_slots [j ].pc -= delta ;
1095610958 }
10959+ for (j = 0 ; j < s -> column_number_count ; j ++ ) {
10960+ if (s -> column_number_slots [j ].pc > pos ) {
10961+ s -> column_number_slots [j ].pc -= delta ;
10962+ }
10963+ }
1095710964 continue ;
1095810965 }
1095910966 break ;
0 commit comments