mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix issue where in error messages, integers were assumed to be unicode characters.
This commit is contained in:
@@ -3388,6 +3388,7 @@ INLINE void expr_rewrite_const_int(Expr *expr, Type *type, uint64_t v)
|
||||
}
|
||||
(&expr->const_expr)->ixx.i.low = v;
|
||||
(&expr->const_expr)->ixx.type = kind;
|
||||
(&expr->const_expr)->is_character = false;
|
||||
(&expr->const_expr)->const_kind = CONST_INTEGER;
|
||||
}
|
||||
|
||||
|
||||
@@ -857,6 +857,7 @@ Expr *expr_new_const_int(SourceSpan span, Type *type, uint64_t v)
|
||||
}
|
||||
expr->const_expr.ixx.i.low = v;
|
||||
expr->const_expr.ixx.type = kind;
|
||||
expr->const_expr.is_character = false;
|
||||
expr->const_expr.const_kind = CONST_INTEGER;
|
||||
expr->resolve_status = RESOLVE_DONE;
|
||||
return expr;
|
||||
|
||||
@@ -1402,6 +1402,7 @@ EXIT:
|
||||
return poisoned_expr;
|
||||
}
|
||||
expr_int->const_expr.const_kind = CONST_INTEGER;
|
||||
expr_int->const_expr.is_character = false;
|
||||
expr_int->const_expr.is_hex = hex_characters > 0;
|
||||
Type *type_base = NULL;
|
||||
if (type_bits)
|
||||
|
||||
@@ -1297,10 +1297,11 @@ static void vector_const_initializer_convert_to_type(ConstInitializer *initializ
|
||||
if (is_neg_conversion)
|
||||
{
|
||||
bool is_true = initializer->init_value->const_expr.b;
|
||||
initializer->init_value->const_expr.const_kind = CONST_INTEGER;
|
||||
initializer->init_value->const_expr.ixx = (Int)
|
||||
{ .i = is_true ? (Int128) { UINT64_MAX, UINT64_MAX } : (Int128) { 0, 0 },
|
||||
.type = to_flat->type_kind };
|
||||
initializer->init_value->const_expr = (ExprConst)
|
||||
{
|
||||
.const_kind = CONST_INTEGER,
|
||||
.ixx = (Int) { .i = is_true ? (Int128) { UINT64_MAX, UINT64_MAX } : (Int128) { 0, 0 }, .type = to_flat->type_kind },
|
||||
};
|
||||
initializer->init_value->type = to_type;
|
||||
}
|
||||
else
|
||||
@@ -1368,6 +1369,7 @@ static void cast_float_to_int(Expr *expr, Type *type)
|
||||
Real d = expr->const_expr.fxx.f;
|
||||
expr->const_expr.ixx = int_from_real(d, type_flatten(type)->type_kind);
|
||||
expr->const_expr.const_kind = CONST_INTEGER;
|
||||
expr->const_expr.is_character = false;
|
||||
expr->type = type;
|
||||
expr->const_expr.is_hex = false;
|
||||
}
|
||||
|
||||
@@ -3295,6 +3295,7 @@ static inline bool sema_create_const_min(SemaContext *context, Expr *expr, Type
|
||||
{
|
||||
expr->expr_kind = EXPR_CONST;
|
||||
expr->const_expr.const_kind = CONST_INTEGER;
|
||||
expr->const_expr.is_character = false;
|
||||
expr->type = type;
|
||||
expr->resolve_status = RESOLVE_DONE;
|
||||
expr->const_expr.ixx.type = flat->type_kind;
|
||||
@@ -3398,6 +3399,7 @@ static inline bool sema_create_const_max(SemaContext *context, Expr *expr, Type
|
||||
{
|
||||
expr->expr_kind = EXPR_CONST;
|
||||
expr->const_expr.const_kind = CONST_INTEGER;
|
||||
expr->const_expr.is_character = false;
|
||||
expr->type = type;
|
||||
expr->resolve_status = RESOLVE_DONE;
|
||||
expr->const_expr.ixx.type = flat->type_kind;
|
||||
@@ -4959,6 +4961,7 @@ static bool sema_expr_analyse_enum_add_sub(SemaContext *context, Expr *expr, Exp
|
||||
expr->const_expr.ixx = int_add(left->const_expr.ixx, right->const_expr.ixx);
|
||||
}
|
||||
expr->const_expr.const_kind = CONST_INTEGER;
|
||||
expr->const_expr.is_character = false;
|
||||
expr->expr_kind = EXPR_CONST;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.4.673"
|
||||
#define COMPILER_VERSION "0.4.674"
|
||||
Reference in New Issue
Block a user