diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-13 16:51:51 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-13 16:51:51 +0000 |
commit | 9ff19ea62ce51ec67ab3fe646aec8a5b3d8b06ce (patch) | |
tree | 71368a5656a5b0eca423488c0c78d55c38c3cdc3 /gdb/opencl-lang.c | |
parent | 599663b891b44af7854305c29b2e5c9036d3d18a (diff) | |
download | gdb-9ff19ea62ce51ec67ab3fe646aec8a5b3d8b06ce.tar.gz |
PR exp/15364:
* eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT,
STRUCTOP_PTR>: Return a not_lval value for
EVAL_AVOID_SIDE_EFFECTS.
* opencl-lang.c (evaluate_subexp_opencl): Return a not_lval value
for EVAL_AVOID_SIDE_EFFECTS.
gdb/testsuite
* gdb.base/exprs.exp (test_expr): Add regression test.
* gdb.base/exprs.c (null_t_struct): New global.
Diffstat (limited to 'gdb/opencl-lang.c')
-rw-r--r-- | gdb/opencl-lang.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index d7e66c46585..4720e2b1944 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -1035,10 +1035,13 @@ Cannot perform conditional operation on vectors with different sizes")); } else { - /* Also handle EVAL_AVOID_SIDE_EFFECTS. */ - return value_struct_elt (&arg1, NULL, - &exp->elts[pc + 2].string, NULL, - "structure"); + struct value *v = value_struct_elt (&arg1, NULL, + &exp->elts[pc + 2].string, NULL, + "structure"); + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + v = value_zero (value_type (v), not_lval); + return v; } } default: |