@@ -2067,6 +2067,7 @@ void checked_read_object_core(struct flow_visit_ctx* ctx,
20672067 struct object_visitor * p_visitor ,
20682068 bool is_nullable ,
20692069 const struct token * position_token ,
2070+ const struct marker * p_marker ,
20702071 bool check_pointed_object ,
20712072 const char * previous_names ,
20722073 unsigned int visit_number )
@@ -2124,6 +2125,7 @@ void checked_read_object_core(struct flow_visit_ctx* ctx,
21242125 & visitor ,
21252126 is_nullable ,
21262127 position_token ,
2128+ p_marker ,
21272129 check_pointed_object ,
21282130 buffer ,
21292131 visit_number );
@@ -2156,6 +2158,7 @@ void checked_read_object_core(struct flow_visit_ctx* ctx,
21562158 p_visitor ,
21572159 is_nullable ,
21582160 position_token ,
2161+ p_marker ,
21592162 check_pointed_object ,
21602163 buffer ,
21612164 visit_number );
@@ -2179,7 +2182,8 @@ void checked_read_object_core(struct flow_visit_ctx* ctx,
21792182 {
21802183 compiler_diagnostic_message (W_FLOW_NULL_DEREFERENCE ,
21812184 ctx -> ctx ,
2182- position_token , NULL ,
2185+ NULL ,
2186+ p_marker ,
21832187 "non-nullable pointer '%s' may be null" ,
21842188 previous_names );
21852189 }
@@ -2200,6 +2204,7 @@ void checked_read_object_core(struct flow_visit_ctx* ctx,
22002204 & visitor ,
22012205 is_nullable ,
22022206 position_token ,
2207+ p_marker ,
22032208 true,
22042209 previous_names ,
22052210 visit_number );
@@ -2243,6 +2248,7 @@ void checked_read_object(struct flow_visit_ctx* ctx,
22432248 bool is_nullable ,
22442249 struct flow_object * p_object ,
22452250 const struct token * position_token ,
2251+ const struct marker * p_marker ,
22462252 bool check_pointed_object )
22472253{
22482254 const char * _Owner _Opt s = NULL ;
@@ -2258,6 +2264,7 @@ void checked_read_object(struct flow_visit_ctx* ctx,
22582264 & visitor ,
22592265 is_nullable ,
22602266 position_token ,
2267+ p_marker ,
22612268 check_pointed_object ,
22622269 name ,
22632270 s_visit_number ++ );
@@ -2543,22 +2550,25 @@ static void flow_assignment_core(
25432550 {
25442551 compiler_diagnostic_message (W_FLOW_UNINITIALIZED ,
25452552 ctx -> ctx ,
2546- error_position , NULL ,
2553+ NULL ,
2554+ p_b_marker ,
25472555 "passing an uninitialized argument '%s' object" , buffer );
25482556 }
25492557 }
25502558 else if (assigment_type == ASSIGMENT_TYPE_RETURN )
25512559 {
25522560 compiler_diagnostic_message (W_FLOW_UNINITIALIZED ,
25532561 ctx -> ctx ,
2554- error_position , NULL ,
2562+ NULL ,
2563+ p_b_marker ,
25552564 "returning an uninitialized '%s' object" , buffer );
25562565 }
25572566 else
25582567 {
25592568 compiler_diagnostic_message (W_FLOW_UNINITIALIZED ,
25602569 ctx -> ctx ,
2561- error_position , NULL ,
2570+ NULL ,
2571+ p_b_marker ,
25622572 "reading an uninitialized '%s' object" , buffer );
25632573 }
25642574
@@ -2573,7 +2583,8 @@ static void flow_assignment_core(
25732583
25742584 compiler_diagnostic_message (W_FLOW_LIFETIME_ENDED ,
25752585 ctx -> ctx ,
2576- error_position , NULL ,
2586+ NULL ,
2587+ p_a_marker ,
25772588 "The object '%s' may have been deleted or its lifetime have ended." , buffer );
25782589
25792590
@@ -2690,8 +2701,8 @@ static void flow_assignment_core(
26902701 //if the anwser is yes then we need a warning
26912702 compiler_diagnostic_message (W_FLOW_MISSING_DTOR ,
26922703 ctx -> ctx ,
2693- error_position ,
26942704 NULL ,
2705+ p_a_marker ,
26952706 "pointed object may be not empty" );
26962707 }
26972708 }
@@ -2740,7 +2751,14 @@ static void flow_assignment_core(
27402751 */
27412752 const bool checked_pointed_object_read = !type_is_out (& t );
27422753 bool is_nullable = a_type_is_nullable || type_is_nullable (& t , ctx -> ctx -> options .null_checks_enabled );
2743- checked_read_object (ctx , p_visitor_b -> p_type , is_nullable , p_visitor_b -> p_object , error_position , checked_pointed_object_read );
2754+
2755+ checked_read_object (ctx ,
2756+ p_visitor_b -> p_type ,
2757+ is_nullable ,
2758+ p_visitor_b -> p_object ,
2759+ error_position ,
2760+ p_b_marker ,
2761+ checked_pointed_object_read );
27442762
27452763
27462764 //object_copy_state(p_a_type, p_a_object, p_b_type, p_b_object);
0 commit comments