git-compat-util: st_add4: work around gcc 4.2.x compiler crash
commitd616fbf256ef3102669d450ddadd8469fefcf95c
authorEric Sunshine <sunshine@sunshineco.com>
Mon, 21 Mar 2016 04:35:57 +0000 (21 00:35 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Mar 2016 16:18:07 +0000 (21 09:18 -0700)
treec80ec676a8d8a9914f3be3557028659755217e99
parent935de81289cd04b4736c538747c53df123c30d1c
git-compat-util: st_add4: work around gcc 4.2.x compiler crash

Although changes by 5b442c4 (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: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h