jit: Add missing type-checking to gcc_jit_{l|r}value_access_field
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 17 Jun 2015 16:04:18 +0000 (16:04 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 17 Jun 2015 16:04:18 +0000 (16:04 +0000)
commit41571b55b1c023158fda594eafa431e943c87819
tree10a4226e3f1ed7c7916021c9e43f14c899f827d4
parentee47f74ef0e961a0168e830919606981ef331c52
jit: Add missing type-checking to gcc_jit_{l|r}value_access_field

gcc/jit/ChangeLog:
* libgccjit.c (gcc_jit_lvalue_access_field): Verify that the field
is for the correct struct.
(gcc_jit_rvalue_access_field): Likewise.

gcc/testsuite/ChangeLog:
* jit.dg/test-error-accessing-field-in-other-struct.c: Rename to...
* jit.dg/test-error-gcc_jit_rvalue_dereference_field-wrong-struct.c:
...this.
* jit.dg/test-error-gcc_jit_lvalue_access_field-wrong-struct.c:
New testcase.
* jit.dg/test-error-gcc_jit_rvalue_access_field-wrong-struct.c:
New testcase.

From-SVN: r224565
gcc/jit/ChangeLog
gcc/jit/libgccjit.c
gcc/testsuite/ChangeLog
gcc/testsuite/jit.dg/test-error-accessing-field-in-other-struct.c [deleted file]
gcc/testsuite/jit.dg/test-error-gcc_jit_lvalue_access_field-wrong-struct.c [new file with mode: 0644]
gcc/testsuite/jit.dg/test-error-gcc_jit_rvalue_access_field-wrong-struct.c [new file with mode: 0644]
gcc/testsuite/jit.dg/test-error-gcc_jit_rvalue_dereference_field-wrong-struct.c [new file with mode: 0644]