Record that `from` now names `to`, allocating room for one rule per expanded * def (`cap`) on first use; an allocation failure only skips the move. */
| 2146 | /* Record that `from` now names `to`, allocating room for one rule per expanded |
| 2147 | * def (`cap`) on first use; an allocation failure only skips the move. */ |
| 2148 | static void cbm_requalify_push(cbm_requalify_rule_t **rules, int *n, int cap, const char *from, |
| 2149 | const char *to, bool raw_wins) { |
| 2150 | if (!from || !to || strcmp(from, to) == 0 || *n >= cap) { |
| 2151 | return; |
| 2152 | } |
| 2153 | if (!*rules) { |
| 2154 | *rules = (cbm_requalify_rule_t *)cbm_calloc(CBM_MEM_CLASS_EXTRACT, |
| 2155 | (size_t)cap * sizeof(cbm_requalify_rule_t)); |
| 2156 | if (!*rules) { |
| 2157 | return; |
| 2158 | } |
| 2159 | } |
| 2160 | (*rules)[(*n)++] = (cbm_requalify_rule_t){from, to, raw_wins}; |
| 2161 | } |
| 2162 | |
| 2163 | /* True when raw def `r` and the remapped expanded def `d` are one definition's |
| 2164 | * site: same label and name, starting on the same original line. */ |
no test coverage detected