Compare the existing definition/carrier identities, not raw pointer bytes. * The new scalar has to be zero on both paths. This is an extraction oracle, * not a claim to serialize or certify a complete pipeline graph. */
| 89 | * The new scalar has to be zero on both paths. This is an extraction oracle, |
| 90 | * not a claim to serialize or certify a complete pipeline graph. */ |
| 91 | static bool tc_legacy_equal(const CBMFileResult *left, const CBMFileResult *right) { |
| 92 | if (!tc_none(left) || !tc_none(right) || !tc_text(left->module_qn, right->module_qn) || |
| 93 | left->has_error != right->has_error || left->is_test_file != right->is_test_file || |
| 94 | left->defs.count != right->defs.count || left->calls.count != right->calls.count || |
| 95 | left->usages.count != right->usages.count) return false; |
| 96 | for (int i = 0; i < left->defs.count; i++) { |
| 97 | const CBMDefinition *a = &left->defs.items[i], *b = &right->defs.items[i]; |
| 98 | if (!tc_text(a->name, b->name) || !tc_text(a->qualified_name, b->qualified_name) || |
| 99 | !tc_text(a->label, b->label) || !tc_text(a->file_path, b->file_path) || |
| 100 | !tc_text(a->signature, b->signature) || a->start_line != b->start_line || |
| 101 | a->end_line != b->end_line || a->is_test != b->is_test) return false; |
| 102 | } |
| 103 | for (int i = 0; i < left->calls.count; i++) { |
| 104 | const CBMCall *a = &left->calls.items[i], *b = &right->calls.items[i]; |
| 105 | if (!tc_text(a->callee_name, b->callee_name) || |
| 106 | !tc_text(a->enclosing_func_qn, b->enclosing_func_qn) || |
| 107 | a->start_line != b->start_line || a->site_start_byte != b->site_start_byte || |
| 108 | a->site_end_byte != b->site_end_byte || a->source_origin != b->source_origin) |
| 109 | return false; |
| 110 | } |
| 111 | for (int i = 0; i < left->usages.count; i++) { |
| 112 | const CBMUsage *a = &left->usages.items[i], *b = &right->usages.items[i]; |
| 113 | if (!tc_text(a->ref_name, b->ref_name) || |
| 114 | !tc_text(a->enclosing_func_qn, b->enclosing_func_qn) || |
| 115 | a->site_start_byte != b->site_start_byte || a->site_end_byte != b->site_end_byte || |
| 116 | a->source_origin != b->source_origin) return false; |
| 117 | } |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | static unsigned tc_line_at(const char *source, uint32_t offset) { |
| 122 | size_t length = strlen(source); |
no test coverage detected