mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
Fix a nasty bug in the executor; and make null-strings be shown as (null) in the trace output
This commit is contained in:
parent
eabe23cc24
commit
67bc99223d
1 changed files with 5 additions and 2 deletions
7
exec.c
7
exec.c
|
@ -344,7 +344,10 @@ static void trace_print_global(qc_program *prog, unsigned int glob, int vtype)
|
|||
value->vector[2]);
|
||||
break;
|
||||
case TYPE_STRING:
|
||||
len += print_escaped_string(prog_getstring(prog, value->string), sizeof(spaces)-len-5);
|
||||
if (value->string)
|
||||
len += print_escaped_string(prog_getstring(prog, value->string), sizeof(spaces)-len-5);
|
||||
else
|
||||
len += printf("(null)");
|
||||
len += printf(",");
|
||||
/* len += printf("\"%s\",", prog_getstring(prog, value->string)); */
|
||||
break;
|
||||
|
@ -532,7 +535,7 @@ static qcint prog_leavefunction(qc_program *prog)
|
|||
#endif
|
||||
if (prev) {
|
||||
qcint *globals = prog->globals + prev->firstlocal;
|
||||
memcpy(globals, prog->localstack + oldsp, prev->locals);
|
||||
memcpy(globals, prog->localstack + oldsp, prev->locals * sizeof(prog->localstack[0]));
|
||||
/* vec_remove(prog->localstack, oldsp, vec_size(prog->localstack)-oldsp); */
|
||||
vec_shrinkto(prog->localstack, oldsp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue