This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCHv5][Kasan] Allow to override Asan shadow offset from command line
- From: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- To: Yury Gribov <y dot gribov at samsung dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Dmitry Vyukov <dvyukov at google dot com>, Andrey Ryabinin <a dot ryabinin at samsung dot com>, Ian Lance Taylor <ian at airs dot com>
- Date: Wed, 5 Nov 2014 17:50:01 +0300
- Subject: Re: [PATCHv5][Kasan] Allow to override Asan shadow offset from command line
- Authentication-results: sourceware.org; auth=none
- References: <540DBD37 dot 9060702 at samsung dot com> <5416B566 dot 2000601 at samsung dot com> <5429951B dot 90900 at samsung dot com> <5440CADD dot 6060100 at samsung dot com> <544A5A95 dot 6030502 at samsung dot com>
Hello,
On 24 Oct 17:56, Yury Gribov wrote:
...
> +const struct test_data_t test_data[] = {
> + { STRTOL, "-0x80000000", 0, -0x80000000L, 0 },
...
> + switch (test_data[i].fun)
> + {
> + case STRTOL:
> + res = strtol (test_data[i].nptr, 0, test_data[i].base);
> + break;
As far as we might have `long long int' on 32-bit, `res' will fail
to compare with corresponding `test_data[i].base'.
Tiny patch fixes it.
--
Thanks, K
diff --git a/libiberty/testsuite/test-strtol.c b/libiberty/testsuite/test-strtol.c
index 96d6871..6faf81b 100644
--- a/libiberty/testsuite/test-strtol.c
+++ b/libiberty/testsuite/test-strtol.c
@@ -132,7 +132,8 @@ run_tests (const struct test_data_t *test_data, size_t ntests)
switch (test_data[i].fun)
{
case STRTOL:
- res = strtol (test_data[i].nptr, 0, test_data[i].base);
+ res = (unsigned long) strtol (test_data[i].nptr,
+ 0, test_data[i].base);
break;
case STRTOUL:
res = strtoul (test_data[i].nptr, 0, test_data[i].base);