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

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