Issue error on erroneous expression
A while back I discovered that this does not issue an error: (gdb) p $x = (void * ) 57 $3 = (void *) 0x39 (gdb) p $x + 7 = 3 $6 = (void *) 0x3 This patch fixes the bug. Regression tested on x86-64 Fedora 36. Reviewed-By: Bruno Larsen <blarsen@redhat.com> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19312
This commit is contained in:
parent
4c9066e322
commit
3592bebbbf
2 changed files with 9 additions and 1 deletions
|
@ -93,7 +93,7 @@ value_ptradd (struct value *arg1, LONGEST arg2)
|
|||
|
||||
result = value_from_pointer (valptrtype,
|
||||
value_as_address (arg1) + sz * arg2);
|
||||
if (result->lval () != lval_internalvar)
|
||||
if (arg1->lval () != lval_internalvar)
|
||||
result->set_component_location (arg1);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue