mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Using a non-const as the end range for a bitstruct would trigger an assert.
This commit is contained in:
@@ -825,7 +825,7 @@ static inline bool sema_analyse_bitstruct_member(SemaContext *context, Decl *par
|
||||
if (end)
|
||||
{
|
||||
// Analyse the end
|
||||
if (!sema_analyse_expr(context, start)) return false;
|
||||
if (!sema_analyse_expr(context, end)) return false;
|
||||
if (!sema_cast_const(end) || !type_is_integer(end->type) || int_is_neg(end->const_expr.ixx))
|
||||
{
|
||||
SEMA_ERROR(end, "This must be a constant non-negative integer value.");
|
||||
|
||||
Reference in New Issue
Block a user