]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Just mark LOCAL_RETURN noref instead of checking for '#' in the name
authorDale Weiler <weilercdale@gmail.com>
Thu, 24 Nov 2016 15:50:48 +0000 (15:50 +0000)
committerDale Weiler <weilercdale@gmail.com>
Thu, 24 Nov 2016 15:50:48 +0000 (15:50 +0000)
ir.cpp
parser.cpp

diff --git a/ir.cpp b/ir.cpp
index 3b78c35a7096a81fd7daa240df505f4890dc0ee1..f5bc4520147f3765be59b31738056d308ec91535 100644 (file)
--- a/ir.cpp
+++ b/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;
         }
     }
index ed5bde108bff5e2455a563bac41fb8db8b649e98..e365316f33068520e62e684be39d97aa9fb0f47b 100644 (file)
@@ -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)) {