Skip to content

Commit c87e106

Browse files
committed
Allow sending a const pointer as argument
1 parent cfa1277 commit c87e106

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

gcc/jit/jit-recording.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,6 @@ class memento_of_get_const : public decorated_type
759759
memento_of_get_const (type *other_type)
760760
: decorated_type (other_type) {}
761761

762-
bool accepts_writes_from (type */*rtype*/) FINAL OVERRIDE
763-
{
764-
/* Can't write to a "const". */
765-
return false;
766-
}
767-
768762
virtual type* copy(context* ctxt)
769763
{
770764
type* result = new memento_of_get_const (m_other_type->copy (ctxt));

gcc/jit/libgccjit.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,7 @@ gcc_jit_block_add_assignment (gcc_jit_block *block,
29282928
RETURN_IF_FAIL (rvalue, ctxt, loc, "NULL rvalue");
29292929
RETURN_IF_FAIL_PRINTF4 (
29302930
gcc_jit_compatible_types ((gcc_jit_type*) lvalue->get_type (),
2931-
(gcc_jit_type*) rvalue->get_type ()),
2931+
(gcc_jit_type*) rvalue->get_type ()) || lvalue->get_type ()->is_const () != NULL,
29322932
ctxt, loc,
29332933
"mismatching types:"
29342934
" assignment to %s (type: %s) from %s (type: %s)",
@@ -2974,7 +2974,7 @@ gcc_jit_block_add_assignment_op (gcc_jit_block *block,
29742974
RETURN_IF_FAIL (rvalue, ctxt, loc, "NULL rvalue");
29752975
RETURN_IF_FAIL_PRINTF4 (
29762976
gcc_jit_compatible_types ((gcc_jit_type*) lvalue->get_type (),
2977-
(gcc_jit_type*) rvalue->get_type ()),
2977+
(gcc_jit_type*) rvalue->get_type ()) || lvalue->get_type ()->is_const () != NULL,
29782978
ctxt, loc,
29792979
"mismatching types:"
29802980
" assignment to %s (type: %s) involving %s (type: %s)",

0 commit comments

Comments
 (0)