Home
last modified time | relevance | path

Searched +full:unsigned +full:- +full:integer +full:- +full:overflow (Results 1 – 25 of 1019) sorted by relevance

12345678910>>...41

/external/compiler-rt/test/ubsan/TestCases/Integer/
Duincdec-overflow.cpp1 // RUN: %clangxx -DOP=n++ -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileChe…
2 // RUN: %clangxx -DOP=++n -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileChe…
3 // RUN: %clangxx -DOP=m-- -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileChe…
4 // RUN: %clangxx -DOP=--m -fsanitize=unsigned-integer-overflow %s -o %t4 && %run %t4 2>&1 | FileChe…
9 unsigned n = 0xfffffffd; in main()
12 unsigned m = 0; in main()
13 …// CHECK-INC: uincdec-overflow.cpp:15:3: runtime error: unsigned integer overflow: 4294967295 + 1 … in main()
14 …// CHECK-DEC: uincdec-overflow.cpp:15:3: runtime error: unsigned integer overflow: 0 - 1 cannot be… in main()
Dno-recover.cpp1 // RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --che…
2-fsanitize=unsigned-integer-overflow -fno-sanitize-recover=all -fsanitize-recover=unsigned-integer…
3 …clangxx -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=unsigned-integer-overflow %s -o…
11 // RECOVER-NOT: runtime error in main()
12 // ABORT-NOT: runtime error in main()
16 …ECOVER: no-recover.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 39895… in main()
17 … ABORT: no-recover.cpp:[[@LINE-2]]:5: runtime error: unsigned integer overflow: 2271560481 + 39895… in main()
20 …// RECOVER: 10000000000000000000 + 9000000000000000000 cannot be represented in type 'unsigned {{l… in main()
21 // ABORT-NOT: runtime error in main()
Dsuppressions.cpp1 // RUN: %clangxx -fsanitize=integer -g0 %s -o %t
3 // Suppression by symbol name (unsigned-integer-overflow:do_overflow below)
4 // requires the compiler-rt runtime to be able to symbolize stack addresses.
5 // REQUIRES: can-symbolize
10 // RUN: echo "signed-integer-overflow:%t" > %t.wrong-supp
11 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.wrong-supp"' not %run %t 2>&1 | FileCheck…
13 // RUN: echo "unsigned-integer-overflow:do_overflow" > %t.func-supp
14 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.func-supp"' %run %t
15 // RUN: echo "unsigned-integer-overflow:%t" > %t.module-supp
16 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.module-supp"' %run %t
[all …]
Dusub-overflow.cpp1 // RUN: %clangxx -DSUB_I32 -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCh…
2 // RUN: %clangxx -DSUB_I64 -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCh…
3 // RUN: %clangxx -DSUB_I128 -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileC…
10 (void)(uint8_t(0) - uint8_t(0x7f)); in main()
11 (void)(uint16_t(0) - uint16_t(0x7fff)); in main()
14 (void)(uint32_t(1) - uint32_t(2)); in main()
15 …// CHECK-SUB_I32: usub-overflow.cpp:[[@LINE-1]]:22: runtime error: unsigned integer overflow: 1 - in main()
19 (void)(uint64_t(8000000000000000000ll) - uint64_t(9000000000000000000ll)); in main()
20 …// CHECK-SUB_I64: 8000000000000000000 - 9000000000000000000 cannot be represented in type 'unsigne… in main()
25 (void)((__uint128_t(1) << 126) - (__uint128_t(1) << 127)); in main()
[all …]
Duadd-overflow.cpp1 // RUN: %clangxx -DADD_I32 -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCh…
2 // RUN: %clangxx -DADD_I64 -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCh…
3 // RUN: %clangxx -DADD_I128 -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileC…
16 …CK-ADD_I32: uadd-overflow.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 … in main()
21 …// CHECK-ADD_I64: 10000000000000000000 + 9000000000000000000 cannot be represented in type 'unsign… in main()
30 …// CHECK-ADD_I128: {{0x80000000000000000000000000000000 \+ 0x80000000000000000000000000000000 cann… in main()
Dnegate-overflow.cpp1 // RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --che…
2 // RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --c…
5 // CHECKS-NOT: runtime error in main()
6 …// CHECKU: negate-overflow.cpp:[[@LINE+2]]:3: runtime error: negation of 2147483648 cannot be repr… in main()
7 // CHECKU-NOT: cast to an unsigned in main()
8 -unsigned(-0x7fffffff - 1); // ok in main()
9 …CHECKS: negate-overflow.cpp:[[@LINE+2]]:10: runtime error: negation of -2147483648 cannot be repre… in main()
10 // CHECKU-NOT: runtime error in main()
11 return -(-0x7fffffff - 1); in main()
Dumul-overflow.cpp1 // RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s
7 (void)(int8_t(-2) * int8_t(0x7f)); in main()
12 // Not an unsigned overflow in main()
16 …// CHECK: umul-overflow.cpp:15:31: runtime error: unsigned integer overflow: 4294967295 * 2 cannot… in main()
/external/python/cpython2/Doc/c-api/
Dlong.rst5 Long Integer Objects
6 --------------------
8 .. index:: object: long integer
13 This subtype of :c:type:`PyObject` represents a Python long integer object.
20 This instance of :c:type:`PyTypeObject` represents the Python long integer type.
46 .. c:function:: PyObject* PyLong_FromUnsignedLong(unsigned long v)
48 Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long`, or
74 .. c:function:: PyObject* PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG v)
76 Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long long`,
82 Return a new :c:type:`PyLongObject` object from the integer part of *v*, or
[all …]
Dint.rst5 Plain Integer Objects
6 ---------------------
8 .. index:: object: integer
13 This subtype of :c:type:`PyObject` represents a Python integer object.
20 This instance of :c:type:`PyTypeObject` represents the Python plain integer type.
45 *pend* is non-*NULL*, ``*pend`` will point to the first character in *str* which
53 and overflow warnings are being suppressed, a :c:type:`PyLongObject` will be
54 returned. If overflow warnings are not being suppressed, *NULL* will be
60 Create a new integer object with a value of *ival*.
62 The current implementation keeps an array of integer objects for all integers
[all …]
/external/clang/test/CodeGen/
Dunsigned-trapv.c1 …UN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=unsigned-integer-overflow
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv | FileCheck %s --check-pr…
3 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=unsigned-integer-overf…
4 // Verify that -ftrapv and -fsanitize=unsigned-integer-overflow
8 // UNSIGNED: @test_signed
13 // UNSIGNED: add nsw i32 in test_signed()
14 // UNSIGNED-NOT: overflow in test_signed()
15 // TRAPV: sadd.with.overflow.i32 in test_signed()
16 // TRAPV-NOT: ubsan in test_signed()
18 // BOTH: sadd.with.overflow.i32 in test_signed()
[all …]
Dsanitize-recover.c1-triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow -fsanitize-recover=unsigned-int…
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow %s -emit-llvm…
3 …g_cc1 -triple x86_64-apple-darwin10 -fsanitize=null,object-size,alignment -fsanitize-recover=objec…
8 extern volatile unsigned x, y, z; in test()
10 // RECOVER: uadd.with.overflow.i32 in test()
12 // RECOVER-NOT: unreachable in test()
13 // ABORT: uadd.with.overflow.i32 in test()
25 // PARTIAL-NEXT: %[[CHECK1:.*]] = icmp uge i64 %[[SIZE]], 4 in foo()
28 // PARTIAL-NEXT: %[[CHECK2:.*]] = icmp eq i64 %[[MISALIGN]], 0 in foo()
31 // PARTIAL-NEXT: %[[CHECK012:.*]] = and i1 %[[CHECK02]], %[[CHECK1]] in foo()
[all …]
Dubsan-blacklist.c2 // RUN: echo "fun:hash" > %t-func.blacklist
3 // RUN: echo "src:%s" > %t-file.blacklist
4 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -emit-llvm %s -o - | FileCheck %s --check-p…
5 … RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-func.blacklist -emit
6 … RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-file.blacklist -emit
8 // FIXME: %t-file.blacklist contains DOSish paths.
11 unsigned i;
16 unsigned hash() { in hash()
18 // FUNC-NOT: call {{.*}}void @__ubsan in hash()
19 // FILE-NOT: call {{.*}}void @__ubsan in hash()
[all …]
Dcompound-assign-overflow.c2-ffreestanding -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fsanitize=signed-integer-overflo…
8 …ate unnamed_addr constant { i16, i16, [15 x i8] } { i16 0, i16 10, [15 x i8] c"'unsigned int'\00" }
Dunsigned-promotion.c1 // Check -fsanitize=signed-integer-overflow and
2 // -fsanitize=unsigned-integer-overflow with promoted unsigned types
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s \
5 // RUN: -fsanitize=signed-integer-overflow | FileCheck %s --check-prefix=CHECKS
6 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s \
7 // RUN: -fsanitize=unsigned-integer-overflow | FileCheck %s --check-prefix=CHECKU
9 unsigned short si, sj, sk;
10 unsigned char ci, cj, ck;
12 extern void opaqueshort(unsigned short);
13 extern void opaquechar(unsigned char);
[all …]
/external/clang/docs/
DUndefinedBehaviorSanitizer.rst12 UBSan modifies the program at compile-time to catch various kinds of undefined
16 * Signed integer overflow
17 * Conversion to, from, or between floating-point types which would
18 overflow the destination
20 See the full list of available :ref:`checks <ubsan-checks>` below.
22 UBSan has an optional run-time library which provides better error reporting.
33 Use ``clang++`` to compile and link your program with ``-fsanitize=undefined``
38 .. code-block:: console
46 % clang++ -fsanitize=undefined test.cc
48 …test.cc:3:5: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type …
[all …]
/external/clang/test/Sema/
Dbuiltins-overflow.c1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 // expected-warning@-1 {{defined as expected}}
9 unsigned r; in test()
12 const unsigned q; in test()
14 …__builtin_add_overflow(); // expected-error {{too few arguments to function call, expected 3, hav… in test()
15 …__builtin_add_overflow(1, 1, 1, 1); // expected-error {{too many arguments to function call, expe… in test()
17 …builtin_add_overflow(c, 1, &r); // expected-error {{operand argument to overflow builtin must be … in test()
18 …builtin_add_overflow(1, c, &r); // expected-error {{operand argument to overflow builtin must be … in test()
19 …dd_overflow(1, 1, 3); // expected-error {{result argument to overflow builtin must be a pointer t… in test()
20 …d_overflow(1, 1, &f); // expected-error {{result argument to overflow builtin must be a pointer t… in test()
[all …]
/external/python/cpython3/Doc/c-api/
Dlong.rst5 Integer Objects
6 ---------------
8 .. index:: object: long integer
9 object: integer
11 All integers are implemented as "long" integer objects of arbitrary size.
13 On error, most ``PyLong_As*`` APIs return ``(return type)-1`` which cannot be
18 This subtype of :c:type:`PyObject` represents a Python integer object.
23 This instance of :c:type:`PyTypeObject` represents the Python integer type.
43 The current implementation keeps an array of integer objects for all integers
44 between ``-5`` and ``256``, when you create an int in that range you actually
[all …]
/external/libchrome/base/numerics/
DREADME.md3 This directory contains a dependency-free, header-only library of templates
4 providing well-defined semantics for safely and performantly handling a variety
12 errors and boundary conditions (e.g. overflow, truncation, etc.).
14 helper functions for performing fast, clamped (i.e. non-sticky saturating)
32 ## Common patterns and use-cases
35 library. Please don't cargo-cult from anywhere else. ��
50 is used in cases where an out-of-bounds source value should be saturated to the
58 ### Enforcing arithmetic conversions at compile-time
60 The `strict_cast` enforces type restrictions at compile-time and results in
66 // Throw a compiler error if byte_value is changed to an out-of-range-type.
[all …]
/external/deqp-deps/SPIRV-Tools/test/
Dparse_number_test.cpp1 // Copyright (c) 2015-2016 The Khronos Group Inc.
7 // http://www.apache.org/licenses/LICENSE-2.0
21 #include "spirv-tools/libspirv.h"
42 EXPECT_TRUE(ParseNumber("-32768", &i16)); in TEST()
43 EXPECT_EQ(-32768, i16); in TEST()
44 EXPECT_TRUE(ParseNumber("-0", &i16)); in TEST()
72 // We don't care about -0 since it's rejected at a higher level. in TEST()
73 EXPECT_FALSE(ParseNumber("-1", &u16)); in TEST()
93 EXPECT_TRUE(ParseNumber("-0", &i32)); in TEST()
95 EXPECT_TRUE(ParseNumber("-1", &i32)); in TEST()
[all …]
/external/swiftshader/third_party/SPIRV-Tools/test/
Dparse_number_test.cpp1 // Copyright (c) 2015-2016 The Khronos Group Inc.
7 // http://www.apache.org/licenses/LICENSE-2.0
21 #include "spirv-tools/libspirv.h"
42 EXPECT_TRUE(ParseNumber("-32768", &i16)); in TEST()
43 EXPECT_EQ(-32768, i16); in TEST()
44 EXPECT_TRUE(ParseNumber("-0", &i16)); in TEST()
72 // We don't care about -0 since it's rejected at a higher level. in TEST()
73 EXPECT_FALSE(ParseNumber("-1", &u16)); in TEST()
93 EXPECT_TRUE(ParseNumber("-0", &i32)); in TEST()
95 EXPECT_TRUE(ParseNumber("-1", &i32)); in TEST()
[all …]
/external/compiler-rt/lib/ubsan/
Dubsan_checks.inc1 //===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===//
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
20 UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined")
21 UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null")
22 UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment")
23 UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size")
24 UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
25 "signed-integer-overflow")
26 UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow",
[all …]
/external/mesa3d/src/gallium/auxiliary/gallivm/
Dlp_bld_arit_overflow.c20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
34 * for overflow detection and reporting.
65 LLVMBuilderRef builder = gallivm->builder; in build_binary_int_overflow()
69 unsigned type_width; in build_binary_int_overflow()
87 oelems[1] = LLVMInt1TypeInContext(gallivm->context); in build_binary_int_overflow()
89 otype = LLVMStructTypeInContext(gallivm->context, oelems, 2, FALSE); in build_binary_int_overflow()
106 * Performs unsigned addition of two integers and reports
107 * overflow if detected.
109 * The values @a and @b must be of the same integer type. If
110 * an overflow is detected the IN/OUT @ofbit parameter is used:
[all …]
/external/dng_sdk/source/
Ddng_safe_arithmetic.h9 * http://www.apache.org/licenses/LICENSE-2.0
18 // Functions for safe arithmetic (guarded against overflow) on integer types.
30 #define __has_builtin(x) 0 // Compatibility with non-Clang compilers.
38 // under-/overflow), stores this result in *result and returns true. Otherwise,
43 // (without under-/overflow). Otherwise, throws a dng_exception with error code
60 // If the subtraction of arg2 from arg1 will not result in an int32_t under- or
61 // overflow, stores this result in *result and returns true. Otherwise,
66 // result in an int32_t under- or overflow. Otherwise, throws a dng_exception
76 // (without overflow). Otherwise, throws a dng_exception with error code
100 // (without overflow). Otherwise, throws a dng_exception with error code
[all …]
/external/compiler-rt/test/ubsan/TestCases/Float/
Dcast-overflow.cpp1 // RUN: %clangxx -fsanitize=float-cast-overflow %s -o %t
3 …ubsan_opts=print_summary=1:report_error_type=1 %run %t 0 2>&1 | FileCheck %s --check-prefix=CHECK-0
4 // RUN: %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-1
5 // RUN: %run %t 2 2>&1 | FileCheck %s --check-prefix=CHECK-2
6 // RUN: %run %t 3 2>&1 | FileCheck %s --check-prefix=CHECK-3
7 // RUN: %run %t 4 2>&1 | FileCheck %s --check-prefix=CHECK-4
8 // RUN: %run %t 5 2>&1 | FileCheck %s --check-prefix=CHECK-5
9 // RUN: %run %t 6 2>&1 | FileCheck %s --check-prefix=CHECK-6
10 // FIXME: %run %t 7 2>&1 | FileCheck %s --check-prefix=CHECK-7
11 // FIXME: not %run %t 8 2>&1 | FileCheck %s --check-prefix=CHECK-8
[all …]
/external/libchrome/libchrome_tools/patch/
Dstatfs_f_type.patch2 # values will overflow it, causing narrowing warnings. Cast to the largest
3 # possible unsigned integer type to avoid it.
5 --- a/base/files/file_util_linux.cc
7 @@ -6,6 +6,7 @@
15 @@ -23,7 +24,10 @@ bool GetFileSystemType(const FilePath& p
19 - switch (statfs_buf.f_type) {
21 + // the values will overflow it, causing narrowing warnings. Cast to the
22 + // largest possible unsigned integer type to avoid it.
27 --- a/base/sys_info_posix.cc
29 @@ -90,7 +90,10 @@ bool IsStatsZeroIfUnlimited(const base::FilePath& path) {
[all …]

12345678910>>...41