diff options
author | 2014-11-21 14:24:04 -0800 | |
---|---|---|
committer | 2014-11-21 14:24:04 -0800 | |
commit | ebacb6127a952910f43a59460af43427d93df46c (patch) | |
tree | 7781d40b33408e4ad821e339fef6d64eb2bd566f /gyp | |
parent | 5ec443c506ed5b180018091c2d192e013dfb44ce (diff) |
Add -ftrapv to debug builds.
This adds instrumentation to check that signed integers never under- or
overflow, which is undefined behavior.
BUG=skia:3096
Review URL: https://codereview.chromium.org/702893003
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/common_conditions.gypi | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 059806f5e3..16841512c1 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -414,6 +414,7 @@ 'ldflags': ['--coverage'], }, 'Debug': { + 'cflags': ['-ftrapv'], # Crash on signed integer over/underflow. }, 'Release': { 'cflags': [ @@ -594,7 +595,7 @@ ], 'configurations': { 'Debug': { - 'cflags': ['-g'] + 'cflags': ['-g', '-ftrapv'] }, 'Release': { 'cflags': ['-O2'], |