sema: use ast field here, add assertion
This commit is contained in:
parent
632fe260fe
commit
db91cf09fc
1 changed files with 2 additions and 1 deletions
|
@ -709,10 +709,11 @@ sema_var_decl(SemaCtx *sctx, AstVarDecl *decl, Location loc)
|
||||||
compiler_assert(sctx->cm, dexpr_dt != nil);
|
compiler_assert(sctx->cm, dexpr_dt != nil);
|
||||||
decl->type = dexpr_dt;
|
decl->type = dexpr_dt;
|
||||||
}
|
}
|
||||||
|
compiler_assert(sctx->cm, decl->type != nil);
|
||||||
|
|
||||||
Symbol sym = {
|
Symbol sym = {
|
||||||
.kind = decl->kind,
|
.kind = decl->kind,
|
||||||
.dtype = dtype,
|
.dtype = decl->type,
|
||||||
.loc = loc,
|
.loc = loc,
|
||||||
};
|
};
|
||||||
/* Insert the variable to the symbol table */
|
/* Insert the variable to the symbol table */
|
||||||
|
|
Loading…
Add table
Reference in a new issue