Commit 96a87981 by David Malcolm Committed by David Malcolm

jit: prevent ICE with type mismatch in gcc_jit_block_add_assignment_op

gcc/jit/ChangeLog:
	* libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
	lvalue and the rvalue are of compatible type.

gcc/testsuite/ChangeLog:
	* jit.dg/test-error-mismatching-types-in-assignment-op.c: New
	test case.

From-SVN: r219681
parent 548c43e7
2015-01-15 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_block_add_assignment_op): Check that the
lvalue and the rvalue are of compatible type.
2015-01-13 David Malcolm <dmalcolm@redhat.com>
* docs/cp/topics/contexts.rst (Debugging): Add
......
......@@ -1900,6 +1900,16 @@ gcc_jit_block_add_assignment_op (gcc_jit_block *block,
"unrecognized value for enum gcc_jit_binary_op: %i",
op);
RETURN_IF_FAIL (rvalue, ctxt, loc, "NULL rvalue");
RETURN_IF_FAIL_PRINTF4 (
compatible_types (lvalue->get_type (),
rvalue->get_type ()),
ctxt, loc,
"mismatching types:"
" assignment to %s (type: %s) involving %s (type: %s)",
lvalue->get_debug_string (),
lvalue->get_type ()->get_debug_string (),
rvalue->get_debug_string (),
rvalue->get_type ()->get_debug_string ());
gcc::jit::recording::statement *stmt = block->add_assignment_op (loc, lvalue, op, rvalue);
......
2015-01-15 David Malcolm <dmalcolm@redhat.com>
* jit.dg/test-error-mismatching-types-in-assignment-op.c: New
test case.
2015-01-15 Mike Stump <mikestump@comcast.net>
* gcc.dg/inline_1.c: Rename gcc.dg/inline_[1-4].c to inline-3[6-9].c.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment