From f34e1093fb3adbcd9fb17ed96d552d2b315d7eca Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Fri, 20 May 2016 16:05:13 +0300 Subject: [PATCH] Take into account target data type width instead of mask bit width, when deciding on the type of small integers data type (int8/int16). --- lex.ll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lex.ll b/lex.ll index 87a80145..2dd38a36 100644 --- a/lex.ll +++ b/lex.ll @@ -637,14 +637,14 @@ lParseInteger(bool dotdotdot) { // No u or l suffix // If we're compiling to an 8-bit mask target and the constant // fits into 8 bits, return an 8-bit int. - if (g->target->getMaskBitCount() == 8) { + if (g->target->getDataTypeWidth() == 8) { if (yylval.intVal <= 0x7fULL) return TOKEN_INT8_CONSTANT; else if (yylval.intVal <= 0xffULL) return TOKEN_UINT8_CONSTANT; } // And similarly for 16-bit masks and constants - if (g->target->getMaskBitCount() == 16) { + if (g->target->getDataTypeWidth() == 16) { if (yylval.intVal <= 0x7fffULL) return TOKEN_INT16_CONSTANT; else if (yylval.intVal <= 0xffffULL)