]> git.eshelyaron.com Git - emacs.git/commitdiff
Add comment explaining gcc_jit_context_new_bitcast usage.
authorVibhav Pant <vibhavp@gmail.com>
Tue, 4 Oct 2022 19:31:50 +0000 (01:01 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Tue, 4 Oct 2022 19:50:07 +0000 (01:20 +0530)
src/comp.c

index 794501f11b0de1ea77a5b93c179120f0ef66261d..b7541c5d9f7297bcd86179011ddb443e2f7ff316 100644 (file)
@@ -1179,6 +1179,11 @@ emit_coerce (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
 
   gcc_jit_rvalue *tmp = obj;
 
+  /* `gcc_jit_context_new_bitcast` requires that the types being converted
+     between have the same layout and as such, doesn't allow converting
+     between an arbitrarily sized integer/boolean and a pointer. Casting it
+     to a uintptr/void* is still necessary, to ensure that it can be bitcast
+     into a (void *)/uintptr respectively.  */
   if (old_is_ptr != new_is_ptr)
     {
       if (old_is_ptr)