Allow subscripting raw pointers
This will be useful for dealing with vectors; regardless of our final solution for the Index trait. 2016-07-06 Manish Goregaokar <manish@mozilla.com> gdb/ChangeLog: * rust-lang.c (rust_subscript): Allow subscripting pointers gdb/testsuite/ChangeLog: * simple.rs: Add test for raw pointer subscripting * simple.exp: Add test expectations
This commit is contained in:
parent
6949d8a719
commit
42d940118a
5 changed files with 17 additions and 0 deletions
|
@ -1415,6 +1415,12 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
|
|||
low_bound = 0;
|
||||
high_bound = value_as_long (len);
|
||||
}
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
{
|
||||
base = lhs;
|
||||
low_bound = 0;
|
||||
high_bound = LONGEST_MAX;
|
||||
}
|
||||
else
|
||||
error (_("Cannot subscript non-array type"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue