diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-05-24 16:53:58 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-05-27 13:07:15 +0100 |
commit | 51415b9f309443261016ad1b63b9e350bbe3903d (patch) | |
tree | a415586fc32281847ef2611a8b2e92dbb8846456 /gdb/opencl-lang.c | |
parent | ac775bf4d35b7a2d5715e0ccf3d648d4670213fd (diff) | |
download | gdb-51415b9f309443261016ad1b63b9e350bbe3903d.zip gdb-51415b9f309443261016ad1b63b9e350bbe3903d.tar.gz gdb-51415b9f309443261016ad1b63b9e350bbe3903d.tar.bz2 |
gdb: Forward VALUE_LVAL when avoiding side effects for STRUCTOP_STRUCT
When evaluating an expression with EVAL_AVOID_SIDE_EFFECTS if the value
we return is forced to be of type not_lval then GDB will be unable to
take the address of the returned value.
Instead, we should properly initialise the LVAL of the returned value.
This commit builds on two previous commits 2520f728b710 (Forward
VALUE_LVAL when avoiding side effects for STRUCTOP_STRUCT) and
ac775bf4d35b (gdb: Forward VALUE_LVAL when avoiding side effects for
STRUCTOP_PTR), which in turn build on ac1ca910d74d (Fixes for PR
exp/15364).
This commit is currently untested due to my lack of access to an OpenCL
compiler, however, if follows the same pattern as the first two commits
mentioned above and so I believe that it is correct.
gdb/ChangeLog:
* opencl-lang.c (evaluate_subexp_opencl): If
EVAL_AVOID_SIDE_EFFECTS mode, forward the VALUE_LVAL attribute to
the returned value in the STRUCTOP_STRUCT case.
Diffstat (limited to 'gdb/opencl-lang.c')
-rw-r--r-- | gdb/opencl-lang.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 7799735..767d3bc 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -984,7 +984,7 @@ Cannot perform conditional operation on vectors with different sizes")); "structure"); if (noside == EVAL_AVOID_SIDE_EFFECTS) - v = value_zero (value_type (v), not_lval); + v = value_zero (value_type (v), VALUE_LVAL (v)); return v; } } |