- Timestamp:
- 2006-10-01T12:55:48+02:00 (7 years ago)
- File:
-
- 1 edited
-
trunk/coverager.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/coverager.c
r207 r208 147 147 for (; len >= sizeof(long) * 2; len -= sizeof(long) * 2, p += 2) { 148 148 if (zend_hash_index_find(cov, p[0], (void**)&phits) == SUCCESS) { 149 if (p[1] <= 0) {150 /* already marked */149 if (p[1] == 0) { 150 /* OPTIMIZE: already marked */ 151 151 continue; 152 152 } 153 if (*phits > 0) { 154 p[1] += *phits; 155 } 153 p[1] += *phits; 156 154 } 157 155 zend_hash_index_update(cov, p[0], &p[1], sizeof(p[1]), NULL); … … 173 171 while (zend_hash_get_current_data_ex(cov, (void**)&phits, &pos) == SUCCESS) { 174 172 *p++ = pos->h; 175 if (*phits <= 0) { 176 *p++ = 0; 177 } 178 else { 179 *p++ = *phits; 173 *p++ = *phits; 174 if (*phits > 0) { 180 175 covlines ++; 181 176 } … … 208 203 { 209 204 if (XG(coverages)) { 205 HashPosition pos; 206 coverager_t *pcov; 207 208 zend_hash_internal_pointer_reset_ex(XG(coverages), &pos); 209 while (zend_hash_get_current_data_ex(XG(coverages), (void **) &pcov, &pos) == SUCCESS) { 210 long *phits; 211 coverager_t cov; 212 HashPosition pos2; 213 uint size; 214 215 cov = *pcov; 216 217 zend_hash_internal_pointer_reset_ex(cov, &pos2); 218 while (zend_hash_get_current_data_ex(cov, (void**)&phits, &pos2) == SUCCESS) { 219 long hits = *phits; 220 221 if (hits != 0) { 222 hits = 0; 223 zend_hash_index_update(cov, pos2->h, &hits, sizeof(hits), NULL); 224 } 225 zend_hash_move_forward_ex(cov, &pos2); 226 } 227 228 zend_hash_move_forward_ex(XG(coverages), &pos); 229 } 230 } 231 } 232 /* }}} */ 233 static void xc_coverager_cleanup(TSRMLS_D) /* {{{ */ 234 { 235 if (XG(coverages)) { 210 236 zend_hash_destroy(XG(coverages)); 211 237 efree(XG(coverages)); … … 218 244 { 219 245 XG(coverage_enabled) = 1; 220 xc_coverager_initenv(TSRMLS_C);221 246 } 222 247 /* }}} */ … … 316 341 if (XG(coverager)) { 317 342 xc_coverager_autodump(TSRMLS_C); 318 xc_coverager_clean (TSRMLS_C);343 xc_coverager_cleanup(TSRMLS_C); 319 344 } 320 345 } … … 352 377 } 353 378 if (zend_hash_index_find(cov, line, (void**)&poldhits) == SUCCESS) { 354 if (hits == -1) {355 /* already marked */379 if (hits == 0) { 380 /* OPTIMIZE: already marked */ 356 381 return; 357 382 } 358 if (*poldhits != -1) { 359 hits += *poldhits; 360 } 383 hits += *poldhits; 361 384 } 362 385 zend_hash_index_update(cov, line, &hits, sizeof(hits), NULL); … … 407 430 case ZEND_EXT_FCALL_END: 408 431 #endif 409 xc_coverager_add_hits(cov, op_array->opcodes[i].lineno, -1TSRMLS_CC);432 xc_coverager_add_hits(cov, op_array->opcodes[i].lineno, 0 TSRMLS_CC); 410 433 break; 411 434 }
Note: See TracChangeset
for help on using the changeset viewer.

