mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
it's not the IR's job to fail when a local of the same name is created twice...
This commit is contained in:
parent
39a62f495c
commit
f9746a59ae
2 changed files with 10 additions and 5 deletions
5
ast.c
5
ast.c
|
@ -995,8 +995,11 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
|
|||
/* generate locals */
|
||||
for (i = 0; i < self->locals_count; ++i)
|
||||
{
|
||||
if (!ast_local_codegen(self->locals[i], func->ir_func, false))
|
||||
if (!ast_local_codegen(self->locals[i], func->ir_func, false)) {
|
||||
if (opts_debug)
|
||||
asterror(ast_ctx(self), "failed to generate local `%s`", self->locals[i]->name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < self->exprs_count; ++i)
|
||||
|
|
10
ir.c
10
ir.c
|
@ -138,7 +138,7 @@ static bool irwarning(lex_ctx ctx, int warntype, const char *fmt, ...)
|
|||
va_list ap;
|
||||
int lvl = LVL_WARNING;
|
||||
|
||||
if (!OPTS_WARN(warntype))
|
||||
if (warntype && !OPTS_WARN(warntype))
|
||||
return false;
|
||||
|
||||
if (opts_werror)
|
||||
|
@ -426,10 +426,12 @@ ir_value* ir_function_get_local(ir_function *self, const char *name)
|
|||
|
||||
ir_value* ir_function_create_local(ir_function *self, const char *name, int vtype, bool param)
|
||||
{
|
||||
ir_value *ve = ir_function_get_local(self, name);
|
||||
if (ve) {
|
||||
ir_value *ve;
|
||||
|
||||
/*
|
||||
if (ir_function_get_local(self, name))
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
if (param &&
|
||||
self->locals_count &&
|
||||
|
|
Loading…
Reference in a new issue