Do not do any contents evaluation if not printing contents.

Fixes a segfault when tracing progs caused by the recent entity number
change.
This commit is contained in:
Bill Currie 2012-07-18 10:46:59 +09:00
parent 8691a2fbd1
commit d73b5045d8
1 changed files with 2 additions and 3 deletions

View File

@ -717,7 +717,7 @@ global_string (progs_t *pr, pr_int_t ofs, etype_t type, int contents)
def = def_string (pr, ofs, line);
if (def || type != ev_void) {
if (contents && (def || type != ev_void)) {
const char *oi = "";
if (def) {
if (type == ev_void)
@ -734,8 +734,7 @@ global_string (progs_t *pr, pr_int_t ofs, etype_t type, int contents)
if (strequal(line->str, "IMMEDIATE") || strequal(line->str, ".imm")) {
dsprintf (line, "%s", s);
} else {
if (contents)
dasprintf (line, "%s(%s)", oi, s);
dasprintf (line, "%s(%s)", oi, s);
}
}
return line->str;