Change limit

This commit is contained in:
Stephan Hadinger 2021-10-20 23:06:29 +02:00
parent 13e8287554
commit 85a0ba4b6d
1 changed files with 13 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#include "be_decoder.h"
#include "be_debug.h"
#include "be_exec.h"
#include <limits.h>
#define OP_NOT_BINARY TokenNone
#define OP_NOT_UNARY TokenNone
@ -30,6 +31,17 @@
#define FUNC_METHOD 1
#define FUNC_ANONYMOUS 2
#if BE_INTGER_TYPE == 0 /* int */
#define M_IMAX INT_MAX
#define M_IMIN INT_MIN
#elif BE_INTGER_TYPE == 1 /* long */
#define M_IMAX LONG_MAX
#define M_IMIN LONG_MIN
#else /* int64_t (long long) */
#define M_IMAX LLONG_MAX
#define M_IMIN LLONG_MIN
#endif
/* get binary operator priority */
#define binary_op_prio(op) (binary_op_prio_tab[cast_int(op) - OptAdd])
@ -1075,7 +1087,7 @@ static void sub_expr(bparser *parser, bexpdesc *e, int prio)
init_exp(&e2, ETVOID, 0);
sub_expr(parser, &e2, binary_op_prio(op)); /* parse right side */
if ((e2.type == ETVOID) && (op == OptConnect)) {
init_exp(&e2, ETINT, -1);
init_exp(&e2, ETINT, M_IMAX);
} else {
check_var(parser, &e2); /* check if valid */
}