mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Do not segfault when printing a pointer value with a bogus type
This commit is contained in:
parent
28ba4b5712
commit
b8127f7543
1 changed files with 3 additions and 1 deletions
|
@ -279,6 +279,7 @@ static void
|
||||||
print_value (expr_t *e, int level, int id)
|
print_value (expr_t *e, int level, int id)
|
||||||
{
|
{
|
||||||
int indent = level * 2 + 2;
|
int indent = level * 2 + 2;
|
||||||
|
type_t *type;
|
||||||
const char *label = "?!?";
|
const char *label = "?!?";
|
||||||
|
|
||||||
switch (e->e.value.type) {
|
switch (e->e.value.type) {
|
||||||
|
@ -302,8 +303,9 @@ print_value (expr_t *e, int level, int id)
|
||||||
e->e.value.v.quaternion_val[3]);
|
e->e.value.v.quaternion_val[3]);
|
||||||
break;
|
break;
|
||||||
case ev_pointer:
|
case ev_pointer:
|
||||||
|
type = e->e.value.v.pointer.type;
|
||||||
label = va ("(%s)[%d]",
|
label = va ("(%s)[%d]",
|
||||||
pr_type_name[e->e.value.v.pointer.type->type],
|
type ? pr_type_name[type->type] : "???",
|
||||||
e->e.value.v.pointer.val);
|
e->e.value.v.pointer.val);
|
||||||
break;
|
break;
|
||||||
case ev_field:
|
case ev_field:
|
||||||
|
|
Loading…
Reference in a new issue