mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Assert on optional-returning-function in a comma expression. #2722
This commit is contained in:
@@ -197,8 +197,7 @@ static void llvm_emit_cond(GenContext *c, BEValue *be_value, Expr *expr, bool bo
|
||||
ByteSize last_index = size - 1;
|
||||
for (ByteSize i = 0; i < last_index; i++)
|
||||
{
|
||||
BEValue value;
|
||||
llvm_emit_expr(c, &value, expr->cond_expr[i]);
|
||||
llvm_emit_ignored_expr(c, expr->cond_expr[i]);
|
||||
}
|
||||
|
||||
// Emit the last element.
|
||||
|
||||
@@ -129,6 +129,10 @@ void llvm_value_rvalue(GenContext *c, BEValue *value)
|
||||
|
||||
void llvm_emit_jump_to_optional_exit(GenContext *c, LLVMValueRef opt_value)
|
||||
{
|
||||
if (!c->catch.block)
|
||||
{
|
||||
puts("foekf");
|
||||
}
|
||||
ASSERT_AT(c->last_emitted_loc, c->catch.block && "unexpected emit");
|
||||
bool is_constant_opt = llvm_is_const(opt_value);
|
||||
|
||||
|
||||
@@ -1121,7 +1121,9 @@ static inline bool sema_analyse_cond_list(SemaContext *context, Expr *expr, Cond
|
||||
// 2. Walk through each of our declarations / expressions as if they were regular expressions.
|
||||
for (unsigned i = 0; i < entries - 1; i++)
|
||||
{
|
||||
if (!sema_analyse_expr_rvalue(context, dexprs[i])) return false;
|
||||
Expr *dexpr = dexprs[i];
|
||||
if (!sema_analyse_expr_rvalue(context, dexpr)) return false;
|
||||
if (!sema_expr_check_discard(context, dexpr)) return false;
|
||||
}
|
||||
|
||||
if (!sema_analyse_last_cond(context, dexprs[entries - 1], cond_type, result)) return false;
|
||||
|
||||
Reference in New Issue
Block a user