Branch Coverage

lib/SPVM/Builder/src/spvm_compiler.c
Criterion Covered Total %
branch 123 148 83.1


line true false branch
104 1145 0 if (compiler->runtime) {
109 2227 1145 for (int32_t i = 0; i < compiler->each_compile_allocators->length; i++) {
118 17994 1145 for (int32_t i = 0; i < compiler->class_file_class_names->length; i++) {
120 17994 0 if (class_file_class_name) {
125 17994 1145 for (int32_t i = 0; i < compiler->class_files->length; i++) {
127 17994 0 if (class_file) {
164 1481 2111 if (compiler->basic_types->length == 0) {
172 3266 326 if (basic_type_name) {
195 63 3529 if (yyparse_error_id) {
199 115 3414 if (SPVM_COMPILER_get_error_messages_length(compiler) > 0) {
204 373 3041 if (SPVM_COMPILER_get_error_messages_length(compiler) > 0) {
210 0 3041 assert(compiler->current_each_compile_allocator->memory_blocks_count_tmp == build_opcode_list_start_memory_blocks_count_tmp);
211 0 3041 assert(SPVM_COMPILER_get_error_messages_length(compiler) == 0);
218 0 3592 assert(compiler->current_each_compile_allocator->memory_blocks_count_tmp == compile_start_memory_blocks_count_tmp);
220 551 3041 if (error_id) {
221 13734 551 for (int32_t basic_type_id = compiler_basic_types_base_id; basic_type_id < compiler->basic_types->length; basic_type_id++) {
225 7545 6189 if (found_class_file) {
233 40856 551 for (int32_t constant_string_id = compiler_constant_strings_base_id; constant_string_id < compiler->constant_strings->length; constant_string_id++) {
258 615 4737 for (int32_t i = 0; i < error_messages->length; i++) {
272 34455 0 if (!class_file) {
283 20745 0 for (int32_t i = 0; i < compiler->class_file_class_names->length; i++) {
285 7545 13200 if (strcmp(class_name, class_file_class_name) == 0) {
286 7545 0 if (compiler->class_files->values[i]) {
300 7545 0 if (found_index >= 0) {
301 7059 486 if (found_index < compiler->class_file_class_names->length - 1) {
315 510905 34455 for (int32_t i = 0; i < compiler->class_file_class_names->length; i++) {
317 0 510905 if (strcmp(class_name, class_file_class_name) == 0) {
318 0 0 if (compiler->class_files->values[i]) {
329 34455 0 if (!found) {
340 2651428 74024 for (int32_t i = 0; i < compiler->class_file_class_names->length; i++) {
343 94328 2557100 if (strcmp(class_name, class_file_class_name) == 0) {
354 0 25539 assert(class_file);
370 0 16291 assert(basic_type->id == basic_type_id);
378 58776 0 if (!basic_type) {
419 0 0 for (int32_t i = 0; i < compiler->error_messages->length; i++) {
598 0 82616 if (strcmp(basic_type->name, basic_type_name_expected) != 0) {
605 53326358 3592 for (int32_t i = 0; i < compiler->ops->length; i++) {
678 2322339 520466 if (!var_decl->is_arg) {
690 58776 3592 for (int32_t basic_type_id = compiler->basic_types_base_id; basic_type_id < compiler->basic_types->length; basic_type_id++) {
696 306884 58776 for (method_index = 0; method_index < methods->length; method_index++) {
725 2110 931 if (current_runtime_basic_types_length > 0) {
732 45042 3041 for (int32_t basic_type_id = current_runtime_basic_types_length; basic_type_id < compiler->basic_types->length; basic_type_id++) {
739 0 3041 assert(runtime->basic_types[0]);
741 45042 3041 for (int32_t basic_type_id = current_runtime_basic_types_length; basic_type_id < compiler->basic_types->length; basic_type_id++) {
754 738100 45042 for (int32_t constant_string_index = 0; constant_string_index < basic_type->constant_strings->length; constant_string_index++) {
763 2027 43015 if (basic_type->class_vars->length > 0) {
765 5342 2027 for (int32_t class_var_index = 0; class_var_index < basic_type->class_vars->length; class_var_index++) {
782 13848 31194 if (basic_type->fields->length > 0) {
784 22999 13848 for (int32_t field_index = 0; field_index < basic_type->fields->length; field_index++) {
802 34570 10472 if (basic_type->methods->length > 0) {
804 284473 34570 for (int32_t method_index = 0; method_index < basic_type->methods->length; method_index++) {
809 0 284473 assert(method->opcode_list->length > 0);
841 217309 67164 if (method->args_length > 0) {
844 486727 217309 for (int32_t arg_index = 0; arg_index < method->args_length; arg_index++) {
865 549 44493 if (basic_type->anon_basic_types->length > 0) {
867 7955 549 for (int32_t anon_basic_type_index = 0; anon_basic_type_index < basic_type->anon_basic_types->length; anon_basic_type_index++) {
879 0 45042 assert(basic_type_string->index >= 0);
882 34801 10241 if (basic_type->class_rel_file) {
887 23629 21413 if (basic_type->class_dir) {
892 171 44871 if (basic_type->version_string) {
901 1954 43088 if (basic_type->parent) {
908 29024 16018 if (basic_type->init_method) {
912 739 44303 if (basic_type->destructor_method) {
942 1999 618 if (found_ptr) {
943 3 1996 if (*(found_ptr + 1) == 'c') {
944 3 0 int arg = va_arg(args, int);
947 1302 694 else if (*(found_ptr + 1) == 's') {
948 1261 41 char* arg = va_arg(args, char*);
951 688 6 else if (*(found_ptr + 1) == 'd') {
952 571 117 (void) va_arg(args, int);
955 6 0 else if (*(found_ptr + 1) == '%') {
984 2938 1473 if (compiler->start_file) {
989 3266 1145 if (start_file) {
1020 31285 1145 for (int32_t i = 0; i < include_dirs_length; i++) {