CID 1039677 1039678 1039679
The expression's value does not depend on the operands; often,
this represents an inadvertent logic error.
In doarg: An operation with non-constant operands that
computes a result with constant value (CWE-569)
cell is defined as an int, not a long, so it can't be > INT_MAX.
typedef unsigned int ucell;
typedef int cell;
#endif
+#define CELL_MAX INT_MAX /* assume cell is always int */
struct tagAMX;
typedef cell(*AMX_NATIVE) (struct tagAMX * amx,
error(52); /* only last dimension may be variable length */
size = needsub(&idxtag[numdim]); /* get size; size==0 for
* "var[]" */
-#if INT_MAX < LONG_MAX
+#if INT_MAX < CELL_MAX
if (size > INT_MAX)
error(105); /* overflow, exceeding capacity */
#endif
if (numdim > 0 && dim[numdim - 1] == 0)
error(52); /* only last dimension may be variable length */
size = needsub(&idxtag[numdim]); /* get size; size==0 for "var[]" */
-#if INT_MAX < LONG_MAX
+#if INT_MAX < CELL_MAX
if (size > INT_MAX)
error(105); /* overflow, exceeding capacity */
#endif
*/
size = needsub(&idxtag[arg->numdim]); /* may be zero here,
*it is a pointer anyway */
-#if INT_MAX < LONG_MAX
+#if INT_MAX < CELL_MAX
if (size > INT_MAX)
error(105); /* overflow, exceeding capacity */
#endif