mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 07:31:28 +00:00
Just mark LOCAL_RETURN noref instead of checking for '#' in the name
This commit is contained in:
parent
3a7848d67c
commit
17c0812ae4
2 changed files with 2 additions and 2 deletions
3
ir.cpp
3
ir.cpp
|
@ -656,8 +656,7 @@ bool ir_function_finalize(ir_function *self)
|
|||
return false;
|
||||
}
|
||||
// just a standard variable
|
||||
else if (v->m_name[0] != '#'
|
||||
&& irwarning(v->m_context, WARN_UNUSED_VARIABLE,
|
||||
else if (irwarning(v->m_context, WARN_UNUSED_VARIABLE,
|
||||
"unused variable: `%s`", v->m_name.c_str())) return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2630,6 +2630,7 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou
|
|||
retval = new ast_value(ctx, "#LOCAL_RETURN", TYPE_VOID);
|
||||
retval->adoptType(*expected->m_next);
|
||||
parser->function->m_return_value = retval;
|
||||
parser->function->m_return_value->m_flags |= AST_FLAG_NOREF;
|
||||
}
|
||||
|
||||
if (!exp->compareType(*retval)) {
|
||||
|
|
Loading…
Reference in a new issue