mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 10:41:43 +00:00
Offsetting builtins so we can use 'if builtin!=0' as condition but also allow a '#0' builtin
This commit is contained in:
parent
e102c1632b
commit
43c0343755
2 changed files with 2 additions and 2 deletions
2
ir.c
2
ir.c
|
@ -2862,7 +2862,7 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
|
|||
fun.locals = vec_size(code_globals) - fun.firstlocal;
|
||||
|
||||
if (irfun->builtin)
|
||||
fun.entry = irfun->builtin;
|
||||
fun.entry = irfun->builtin+1;
|
||||
else {
|
||||
irfun->code_function_def = vec_size(code_functions);
|
||||
fun.entry = vec_size(code_statements);
|
||||
|
|
2
parser.c
2
parser.c
|
@ -4028,7 +4028,7 @@ skipvar:
|
|||
}
|
||||
vec_push(parser->functions, func);
|
||||
|
||||
func->builtin = -parser_token(parser)->constval.i;
|
||||
func->builtin = -parser_token(parser)->constval.i-1;
|
||||
}
|
||||
|
||||
if (!parser_next(parser)) {
|
||||
|
|
Loading…
Reference in a new issue