Prevalence of Antipattern for SPR in the GenProg benchmarks

All results in the table below are obtained from patch analysis of the data at: http://rhino.csail.mit.edu/spr-rep/spr-wsf-result/
SPR SPR patch Insert True Insert false Insert part of conditions Delete if-branch Delete while-loop Delete temp-condition Delete-exit Delete return Delete goto Delete error code Insert early return Insert early exit Insert goto
fbc-5458-5459 //prophet generated patch
if (((dst == ((void *)0)) || (dst->data == ((void *)0)) || ((((FBSTRING *)dst)->len & ~2147483648UL) == 0))

|| (len == 0)

) { fb_hStrDelTemp_NoLock(src); fb_hStrDelTemp_NoLock(dst); ; return; }
gmp-13420-13421 //prophet generated patch

b2p = (rp);

gmp-14166-14167 //prophet generated patch
if ((asize < bsize || (asize == bsize && _gmpn_cmp(ap, bp, asize) < 0))

|| (asize == 0)

) { do { mpz_srcptr __mpz_srcptr_swap__tmp = (a); (a) = (b); (b) = __mpz_srcptr_swap__tmp; } while (0); do { do { mp_srcptr __mp_srcptr_swap__tmp = (ap); (ap) = (bp); (bp) = __mp_srcptr_swap__tmp; } while (0); do { mp_size_t __mp_size_t_swap__tmp = (asize); (asize) = (bsize); (bsize) = __mp_size_t_swap__tmp; } while (0); } while (0); do { mpz_ptr __mpz_ptr_swap__tmp = (s); (s) = (t); (t) = __mpz_ptr_swap__tmp; } while (0); }
gzip-3fe0caeada-39a362ae9d if (((flags & 8) != 0) && !(1)) { if (no_name || (to_stdout && !list) || part_nb > 1) { char c; do { c = (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); } while (c != 0); } else { char *p = gzip_base_name(ofname); char *base = p; for (;;) { *p = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0)); if (*p++ == '\x00') break; if (p >= ofname + sizeof (ofname)) { gzip_error("corrupted input -- file name too large"); } } p = gzip_base_name(base); memmove(base, p, strlen(p) + 1); if (!list) { ; if (base) list = 0; } } } 1 1
gzip-a1d3d4019d-f17cbd13a1 /* Accept "-" as synonym for stdin */
//prophet generated patch

ifd = (0);

libtiff-0860361d-1ba75257 //prophet generated patch
if ((!dir->tdir_count || !w || (tsize_t)dir->tdir_count / w != cc)

&& !(1))

goto bad;
1 1 1
libtiff-5b02179-3dfb33b //prophet generated patch
if ((((image->xres == 0) || (image->yres == 0)) && ((crop->crop_mode & 16) || (crop->crop_mode & 1) || (crop->crop_mode & 4) || (crop->crop_mode & 2)))

&& !(1))

{ TIFFError("computeInputPixelOffsets", "Cannot compute margins or fixed size sections without image resolution"); TIFFError("computeInputPixelOffsets", "Specify units in pixels and try again"); return (-1); }
1 1
libtiff-90d136e4-4c66680f //prophet generated patch

if ((1)) goto success;

libtiff-d13be72c-ccadf48a if ((td->td_nstrips > 1 && td->td_compression == 1 && td->td_stripbytecount[0] != td->td_stripbytecount[1])

&& !(1))

{ TIFFWarning(module, "%s: Wrong \"%s\" field, ignoring and calculating from imagelength", tif->tif_name, TIFFFieldWithTag(tif, 279)->field_name); if (EstimateStripByteCounts(tif, dir, dircount) < 0) goto bad; }
1 1 1
libtiff-ee2ce5b7-b5691a5a //prophet generated patch

if ((1)) goto success;

lighttpd-1913-1914 //prophet generated patch
if ((len == 0)

|| (len == 3))

return 0;
1
lighttpd-1948-1949 if (con->send->first == NULL) {
//prophet generated patch

if ((1)) return 783;

if (con->conf.log_request_handling) log_trace("%s.%d: (trace) we can't compress streams: ->first = %p", remove_path("src/mod_compress.c"), 696, con->send->first); return HANDLER_GO_ON; }
1
lighttpd-2330-2331 //prophet generated patch
if ((matched_encodings & (1 << 4))

&& !(1))

{ compression_type = (1 << 4); compression_name = dflt_bzip2; }
1 1
lighttpd-2661-2662 //prophet generated patch

buffer_copy_string_len((str), "", "" ? sizeof ("") - 1 : 0);

php-307562-307561 //prophet generated patch

xmlNodeDump(buf, docp, node, 0, format);

php-307846-307853 //prophet generated patch

memset(&dateobj->time->relative, 0, sizeof (*(&dateobj->time->relative)));

php-307914-307915 //prophet generated patch

spprintf(error, 0, ("Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist"), fname);

php-308525-308529 //prophet generated patch

if ((index == 7)) return;

do {
1 1
php-308734-308761 //prophet generated patch

if ((token_type == 355)) break;

php-309111-309159 //prophet generated patch
{ if (((p = memchr(s, '?', (ue - s))))

&& !(length == 49)

) { pp = (__extension__ (__builtin_constant_p('#') && !__builtin_constant_p(s) && ('#') == '\x00' ? (char *)__rawmemchr(s, '#') : __builtin_strchr(s, '#'))); if (pp && pp < p) { p = pp; goto label_parse; } if (p - s) { ret->path = _estrndup((s), ((p - s))); php_replace_controlchars_ex(ret->path, (p - s)); } if (pp) { if (pp - ++p) { ret->query = _estrndup((p), ((pp - p))); php_replace_controlchars_ex(ret->query, (pp - p)); } p = pp; goto label_parse; } else if (++p - ue) { ret->query = _estrndup((p), ((ue - p))); php_replace_controlchars_ex(ret->query, (ue - p)); } } else if ((p = memchr(s, '#', (ue - s)))) { if (p - s) { ret->path = _estrndup((s), ((p - s))); php_replace_controlchars_ex(ret->path, (p - s)); } label_parse: p++; if (ue - p) { ret->fragment = _estrndup((p), ((ue - p))); php_replace_controlchars_ex(ret->fragment, (ue - p)); } } else { ret->path = _estrndup((s), ((ue - s))); php_replace_controlchars_ex(ret->path, (ue - s)); } }
1
php-309516-309535 //prophet generated patch

memset(&dateobj->time->relative,0,sizeof(*(&dateobj->time->relative)));dateobj->time->relative.y= intobj->diff->y*bias;

php-309579-309580 //prophet generated patch
if ((isostr_len)

|| (isostr != 0))

{
php-309688-309716 //prophet generated patch

phar_request_initialize();

php-309892-309910 //prophet generated patch
if ((len > s1_len - offset)

&& !(1)

) { len = s1_len - offset; }
php-309986-310009 //prophet generated patch
if ((retval)

&& !(1))

{ zval_delref_p(retval); }
1 1
php-310011-310050 ALLOC_INIT_ZVAL(tmp);
ZVAL_COPY_VALUE(tmp, *p);
Z_SET_REFCOUNT_P(tmp, 0);
//prophet generated patch

_zval_copy_ctor_func(tmp);

1
php-310370-310389 //prophet generated patch
if ((op_array->static_variables)

&& !(1)

{ zend_hash_destroy(op_array->static_variables); _efree((op_array->static_variables)); }
1 1
php-310673-310681 //prophet generated patch

_efree(((return_value)));

1
php-310991-310999 //prophet generated patch
if ((!aliases[i]->trait_method->ce || (fn->common.scope == aliases[i]->trait_method->ce && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)))

&& !((!( (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)))

){ if (aliases[i]->alias) { fn_copy = *fn; zend_traits_duplicate_function(&fn_copy, _estrndup((aliases[i]->alias), (aliases[i]->alias_len))); if (aliases[i]->modifiers) { fn_copy.common.fn_flags = aliases[i]->modifiers; if (!(aliases[i]->modifiers & (256 | 512 | 1024))) { fn_copy.common.fn_flags |= 256; } } lcname_len = aliases[i]->alias_len; lcname = zend_str_tolower_dup(aliases[i]->alias, lcname_len); if (_zend_hash_add_or_update(target, lcname, lcname_len + 1, &fn_copy, sizeof(zend_function), ((void *)0), (1 << 1)) == -1) { zend_error((1 << 6L), "Failed to add aliased trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name); } _efree((lcname)); } } i++; }
php-311323-311300 //prophet generated patch
if ((cd->start_code + offset >= group)

|| (1)

) (ptr[1] = (offset + adjust) >> 8) , (ptr[(1) + 1] = (offset + adjust) & 255); }
1 1
php-311346-311348 //prophet generated patch
if ((ctx->buf.len)

|| (1)

) { do { register size_t __nl; smart_str *__dest = (smart_str *)((&ctx->result)); do { if (!(__dest)->c) { (__dest)->len = 0; __nl = (((ctx->buf.len))); (__dest)->a = __nl < 78 ? 78 : __nl + 128; (__dest)->c = (((((0)))) ? __zend_realloc((((__dest)->c)), (((__dest)->a + 1))) : _erealloc(((((__dest)->c))), ((((__dest)->a + 1))), 0)); } else { __nl = (__dest)->len + (((ctx->buf.len))); if (__nl >= (__dest)->a) { (__dest)->a = __nl + 128; (__dest)->c = (((((0)))) ? __zend_realloc((((__dest)->c)), (((__dest)->a + 1))) : _erealloc(((((__dest)->c))), ((((__dest)->a + 1))), 0)); } } } while (0); memcpy(__dest->c + __dest->len, ((ctx->buf.c)), ((ctx->buf.len))); __dest->len = __nl;
1 1
python-69223-69224 //prophet generated patch if ((!rv)

&& !(1)

) { if (set_add_entry((PySetObject *)result, entry) == -1) { do { if (--((PyObject *)(result))->ob_refcnt != 0) ; else ((*(((PyObject *)((PyObject *)(result)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(result)))); } while (0); return ((void *)0); } }
1 1
python-69368-69372 //prophet generated patch
if ((!rv)

&& !(1)

) { if (set_add_entry((PySetObject *)result, entry) == -1) { do { if (--((PyObject *)(result))->ob_refcnt != 0) ; else ((*(((PyObject *)((PyObject *)(result)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(result)))); } while (0); return ((void *)0); } }
1 1
python-69709-69710 //prophet generated patch if ((!rv)

&& !(1)

) { if (set_add_entry((PySetObject *)result, entry) == -1) { do { if (--((PyObject *)(result))->ob_refcnt != 0) ; else ((*(((PyObject *)((PyObject *)(result)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(result)))); } while (0); return ((void *)0); } }
1 1
python-69783-69784 //prophet generated patch if ((acceptval)

&& !(1)

) { if (0 <= y && y < 69) y += 2000; else if (69 <= y && y < 100) y += 1900; else { PyErr_SetString(PyExc_ValueError, "year out of range"); return 0; } if (PyErr_WarnEx(PyExc_DeprecationWarning, "Century info guessed for a 2-digit year.", 1) != 0) return 0; }
python-70019-70023 //prophet generated patch

PyObject_GC_Track(self);

python-70098-70101 //prophet generated patch

PyNode_Compile(PyExc_ValueError, "max_length must be greater than zero");

return NULL;
1
wireshark-37112-37111 //prophet generated patch
if ((key->frame == fd_head->reassembled_in)

&& !(1)

) { do { if (1) g_slice_free1(sizeof(fragment_data), (fd_head)); else (void)((fragment_data *)0 == (fd_head)); } while (0); }
1 1
wireshark-37172-37171 //prophet generated patch

*msgp = ((void *)0);

wireshark-37172-37173 /prophet generated patch

*msgp = ((void *)0);

wireshark-37284-37285 /prophet generated patch

*msgp = ((void *)0);

evaluate to F
Valid
15+6/21+6 is condition that disable or enable branches
N\A
2 11 0 3 6 2 0 2 2 4 2 1 1 0