Skip to content

Commit 34b7698

Browse files
committed
Mark C enums as semantic2done to prevent segfaults in final switch
1 parent cde1278 commit 34b7698

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dmd/enumsem.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ void enumSemantic(Scope* sc, EnumDeclaration ed)
332332
}
333333

334334
ed.memtype = commonType;
335-
ed.semanticRun = PASS.semanticdone;
335+
// Set semantic2done to mark C enums as fully processed
336+
// Prevents issues with final switch statements that reference C enums
337+
ed.semanticRun = PASS.semantic2done;
336338
return;
337339
}
338340

0 commit comments

Comments
 (0)