A blob (fingerprint, retained source): copied verbatim. */
| 152 | |
| 153 | /* A blob (fingerprint, retained source): copied verbatim. */ |
| 154 | static void cr_blob(cr_ctx_t *c, const void **field, size_t bytes) { |
| 155 | if (!*field || bytes == 0) { |
| 156 | return; |
| 157 | } |
| 158 | if (c->phase == CR_RELOCATE) { |
| 159 | if (cr_in_old_block(c, *field)) { |
| 160 | *field = (const char *)*field + c->delta; |
| 161 | } |
| 162 | return; |
| 163 | } |
| 164 | if (c->phase == CR_COPY) { |
| 165 | void *copy = cr_alloc(c, bytes); |
| 166 | if (!copy) { |
| 167 | return; |
| 168 | } |
| 169 | memcpy(copy, *field, bytes); |
| 170 | *field = copy; |
| 171 | } else { |
| 172 | (void)cr_alloc(c, bytes); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /* A record array: copied at exact count, then the caller walks its fields. */ |
| 177 | static void cr_array(cr_ctx_t *c, void **items, int count, size_t elem) { |
no test coverage detected