From cb6eaf13c3b3b58779a18255177589d8d5fbf85b Mon Sep 17 00:00:00 2001 From: A404M Date: Thu, 13 Feb 2025 18:39:08 +0330 Subject: add i8 u8 i16 u16 i32 u32 add overflow warning --- src/runner/runner.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/runner') diff --git a/src/runner/runner.c b/src/runner/runner.c index 2ab97a9..4f2a002 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -328,7 +328,19 @@ AstTree *calcAstTreeValue(AstTree *tree, RunnerVariablePages *pages) { if ((left->type == &AST_TREE_U64_TYPE && right->type == &AST_TREE_U64_TYPE) || (left->type == &AST_TREE_I64_TYPE && - right->type == &AST_TREE_I64_TYPE)) { + right->type == &AST_TREE_I64_TYPE) || + (left->type == &AST_TREE_U32_TYPE && + right->type == &AST_TREE_U32_TYPE) || + (left->type == &AST_TREE_I32_TYPE && + right->type == &AST_TREE_I32_TYPE) || + (left->type == &AST_TREE_U16_TYPE && + right->type == &AST_TREE_U16_TYPE) || + (left->type == &AST_TREE_I16_TYPE && + right->type == &AST_TREE_I16_TYPE) || + (left->type == &AST_TREE_U8_TYPE && + right->type == &AST_TREE_U8_TYPE) || + (left->type == &AST_TREE_I8_TYPE && + right->type == &AST_TREE_I8_TYPE)) { if (left->token == AST_TREE_TOKEN_VALUE_INT && right->token == AST_TREE_TOKEN_VALUE_INT) { switch (tree->token) { -- cgit v1.2.3