Skip to content
  • Eric Sunshine's avatar
    git-compat-util: st_add4: work around gcc 4.2.x compiler crash · d616fbf2
    Eric Sunshine authored and Junio C Hamano's avatar Junio C Hamano committed
    Although changes by 5b442c4f
    
     (tree-diff: catch integer overflow in
    combine_diff_path allocation, 2016-02-19) are perfectly valid, they
    unfortunately trigger an internal compiler error in gcc 4.2.x:
    
        combine-diff.c: In function 'diff_tree_combined':
        combine-diff.c:1391: internal compiler error: Segmentation fault: 11
    
    Experimentation reveals that changing st_add4()'s argument evaluation
    order is sufficient to sidestep this problem.
    
    Although st_add3() does not trigger the compiler bug, for style
    consistency, change its argument evaluation order to match.
    
    Signed-off-by: default avatarEric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    d616fbf2