Continue work on custom SSA; Fix double declaration in when statements

This commit is contained in:
Ginger Bill
2017-04-21 17:56:29 +01:00
parent 4d0afc55c3
commit 91ed51ff5c
10 changed files with 557 additions and 272 deletions
+4 -1
View File
@@ -3,7 +3,9 @@ void check_stmt_list(Checker *c, AstNodeArray stmts, u32 flags) {
return;
}
check_scope_decls(c, stmts, 1.2*stmts.count);
if (flags&Stmt_CheckScopeDecls) {
check_scope_decls(c, stmts, 1.2*stmts.count);
}
bool ft_ok = (flags & Stmt_FallthroughAllowed) != 0;
flags &= ~Stmt_FallthroughAllowed;
@@ -362,6 +364,7 @@ typedef struct TypeAndToken {
#include "map.c"
void check_when_stmt(Checker *c, AstNodeWhenStmt *ws, u32 flags) {
flags &= ~Stmt_CheckScopeDecls;
Operand operand = {Addressing_Invalid};
check_expr(c, &operand, ws->cond);
if (operand.mode != Addressing_Constant || !is_type_boolean(operand.type)) {