summaryrefslogtreecommitdiff
path: root/src/codegen/codegen_stmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/codegen_stmt.c')
-rw-r--r--src/codegen/codegen_stmt.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/codegen/codegen_stmt.c b/src/codegen/codegen_stmt.c
index 55a4be2..1cbd3a2 100644
--- a/src/codegen/codegen_stmt.c
+++ b/src/codegen/codegen_stmt.c
@@ -177,9 +177,19 @@ void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out, int us
ASTNode *ref_check = node->match_stmt.cases;
while (ref_check)
{
- if (ref_check->match_case.is_ref)
+ if (ref_check->match_case.binding_refs)
+ {
+ for (int i = 0; i < ref_check->match_case.binding_count; i++)
+ {
+ if (ref_check->match_case.binding_refs[i])
+ {
+ has_ref_binding = 1;
+ break;
+ }
+ }
+ }
+ if (has_ref_binding)
{
- has_ref_binding = 1;
break;
}
ref_check = ref_check->next;