@@ -810,7 +810,8 @@ static int setter_ARinfo_int32(args_t *args, bcf1_t *line, annot_col_t *col, int
810810
811811 args -> tmpi2 [i ] = args -> tmpi [ map [i ] ];
812812 }
813- return bcf_update_info_int32 (args -> hdr_out ,line ,col -> hdr_key_dst ,args -> tmpi2 ,ndst );
813+ int ret = bcf_update_info_int32 (args -> hdr_out ,line ,col -> hdr_key_dst ,args -> tmpi2 ,ndst );
814+ return ret < 0 ? ret : 1 ;
814815}
815816static int setter_info_int (args_t * args , bcf1_t * line , annot_col_t * col , void * data )
816817{
@@ -919,7 +920,10 @@ static int setter_info_int(args_t *args, bcf1_t *line, annot_col_t *col, void *d
919920 }
920921
921922 if ( col -> number == BCF_VL_A || col -> number == BCF_VL_R )
923+ {
924+ assert (tab );
922925 return setter_ARinfo_int32 (args ,line ,col ,tab -> nals ,tab -> als ,ntmpi );
926+ }
923927
924928 if ( col -> replace & REPLACE_MISSING )
925929 {
@@ -975,7 +979,8 @@ static int setter_ARinfo_real(args_t *args, bcf1_t *line, annot_col_t *col, int
975979
976980 args -> tmpf2 [i ] = args -> tmpf [ map [i ] ];
977981 }
978- return bcf_update_info_float (args -> hdr_out ,line ,col -> hdr_key_dst ,args -> tmpf2 ,ndst );
982+ int ret = bcf_update_info_float (args -> hdr_out ,line ,col -> hdr_key_dst ,args -> tmpf2 ,ndst );
983+ return ret < 0 ? ret : 1 ;
979984}
980985static int setter_info_real (args_t * args , bcf1_t * line , annot_col_t * col , void * data )
981986{
@@ -1103,7 +1108,10 @@ static int setter_info_real(args_t *args, bcf1_t *line, annot_col_t *col, void *
11031108 }
11041109
11051110 if ( col -> number == BCF_VL_A || col -> number == BCF_VL_R )
1111+ {
1112+ assert (tab );
11061113 return setter_ARinfo_real (args ,line ,col ,tab -> nals ,tab -> als ,ntmpf );
1114+ }
11071115
11081116 if ( col -> replace & REPLACE_MISSING )
11091117 {
@@ -3789,7 +3797,7 @@ static int annotate_from_vcf(args_t *args, bcf1_t *line)
37893797 for (j = 0 ; j < args -> ncols ; j ++ )
37903798 {
37913799 if ( !args -> cols [j ].setter ) continue ;
3792- if ( args -> cols [j ].setter (args ,line ,& args -> cols [j ],aline ) )
3800+ if ( args -> cols [j ].setter (args ,line ,& args -> cols [j ],aline ) < 0 )
37933801 error ("fixme: Could not set %s at %s:%" PRId64 "\n" , args -> cols [j ].hdr_key_src ,bcf_seqname (args -> hdr ,line ),(int64_t ) line -> pos + 1 );
37943802 }
37953803 return 1 ;
@@ -3800,7 +3808,7 @@ static int annotate_from_self(args_t *args, bcf1_t *line)
38003808 for (j = 0 ; j < args -> ncols ; j ++ )
38013809 {
38023810 if ( !args -> cols [j ].setter ) continue ;
3803- if ( args -> cols [j ].setter (args ,line ,& args -> cols [j ],NULL ) )
3811+ if ( args -> cols [j ].setter (args ,line ,& args -> cols [j ],NULL ) < 0 )
38043812 error ("fixme: Could not set %s at %s:%" PRId64 "\n" , args -> cols [j ].hdr_key_src ,bcf_seqname (args -> hdr ,line ),(int64_t ) line -> pos + 1 );
38053813 }
38063814 return 0 ;
0 commit comments