Skip to content

Commit

Permalink
libgccjit: Allow casts between integers and pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Dec 10, 2024
1 parent e1857fe commit 45648c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gcc/jit/libgccjit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2533,10 +2533,10 @@ is_valid_cast (gcc::jit::recording::type *src_type,
if (dst_is_int || dst_is_bool)
return true;

/* Permit casts between pointer types. */
/* Permit casts between pointer types and integers and pointers. */
gcc::jit::recording::type *deref_src_type = src_type->is_pointer ();
gcc::jit::recording::type *deref_dst_type = dst_type->is_pointer ();
if (deref_src_type && deref_dst_type)
if ((deref_src_type || src_is_int) && (deref_dst_type || dst_is_int))
return true;

return false;
Expand Down

0 comments on commit 45648c2

Please sign in to comment.