bootstrappable: HAVE_LONG_LONG.

* tccpp.c (parse_number)[!HAVE_LONG_LONG]: Skip overflow test.  Do not
  set TOK_CCLONG.
This commit is contained in:
Jan Nieuwenhuizen 2018-05-15 14:32:39 +02:00
parent 306f6779ad
commit 540ba0b456
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 1 deletions

View File

@ -2388,10 +2388,12 @@ static void parse_number(const char *p)
tcc_error("invalid digit");
n1 = n;
n = n * b + t;
#if HAVE_LONG_LONG
/* detect overflow */
/* XXX: this test is not reliable */
if (n < n1)
tcc_error("integer constant overflow");
#endif
}
/* Determine the characteristics (unsigned and/or 64bit) the type of
@ -2421,11 +2423,14 @@ static void parse_number(const char *p)
}
}
#if HAVE_LONG_LONG
/* Whether 64 bits are needed to hold the constant's value */
if (n & 0xffffffff00000000LL || must_64bit) {
tok = TOK_CLLONG;
n1 = n >> 32;
} else {
} else
#endif
{
tok = TOK_CINT;
n1 = n;
}