From 5fa5ae40beb9d07f6715d8902e102a507ec37b75 Mon Sep 17 00:00:00 2001 From: Damien Date: Sun, 6 Oct 2013 00:13:15 +0100 Subject: [PATCH] Make range of small int 24 bits. --- py/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/parse.c b/py/parse.c index 74bfdf48d6..ba41f749e9 100644 --- a/py/parse.c +++ b/py/parse.c @@ -228,7 +228,7 @@ static void push_result_token(parser_t *parser, const py_lexer_t *lex) { } if (dec) { pn = py_parse_node_new_leaf(PY_PARSE_NODE_DECIMAL, qstr_from_strn_copy(str, len)); - } else if (small_int && -0x10000000 <= int_val && int_val <= 0xfffffff) { // XXX check this range formula! + } else if (small_int && -0x800000 <= int_val && int_val <= 0x7fffff) { // XXX check this range formula! pn = py_parse_node_new_leaf(PY_PARSE_NODE_SMALL_INT, int_val); } else { pn = py_parse_node_new_leaf(PY_PARSE_NODE_INTEGER, qstr_from_strn_copy(str, len));