aboutsummaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorXi Wang <[email protected]>2013-01-11 14:31:48 -0800
committerLinus Torvalds <[email protected]>2013-01-11 14:54:55 -0800
commit6d92d4f6a74766cc885b18218268e0c47fbca399 (patch)
tree9feb7c205f8062ffc1982948d2ffc446cbf94a6b /lib/debugobjects.c
parent7964c06d66c76507d8b6b662bffea770c29ef0ce (diff)
fs/exec.c: work around icc miscompilation
The tricky problem is this check: if (i++ >= max) icc (mis)optimizes this check as: if (++i > max) The check now becomes a no-op since max is MAX_ARG_STRINGS (0x7FFFFFFF). This is "allowed" by the C standard, assuming i++ never overflows, because signed integer overflow is undefined behavior. This optimization effectively reverts the previous commit 362e6663ef23 ("exec.c, compat.c: fix count(), compat_count() bounds checking") that tries to fix the check. This patch simply moves ++ after the check. Signed-off-by: Xi Wang <[email protected]> Cc: Jason Baron <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions