mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
-disasm should show builtins as builtins rather than trying to print negative statements - skip function 0 since it's not a valid function
This commit is contained in:
parent
265e66b98b
commit
b1b586d398
1 changed files with 7 additions and 2 deletions
7
exec.c
7
exec.c
|
@ -922,7 +922,7 @@ int main(int argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
if (opts_disasm) {
|
||||
for (i = 0; i < prog->functions_count; ++i)
|
||||
for (i = 1; i < prog->functions_count; ++i)
|
||||
prog_disasm_function(prog, i);
|
||||
return 0;
|
||||
}
|
||||
|
@ -962,6 +962,11 @@ void prog_disasm_function(qc_program *prog, size_t id)
|
|||
prog_section_function *fdef = prog->functions + id;
|
||||
prog_section_statement *st;
|
||||
|
||||
if (fdef->entry < 0) {
|
||||
printf("FUNCTION \"%s\" = builtin #%i\n", prog_getstring(prog, fdef->name), (int)-fdef->entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
printf("FUNCTION \"%s\"\n", prog_getstring(prog, fdef->name));
|
||||
|
||||
st = prog->code + fdef->entry;
|
||||
|
|
Loading…
Reference in a new issue