This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHv5][Kasan] Allow to override Asan shadow offset from command line


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]