]> git.eshelyaron.com Git - emacs.git/commitdiff
fix awful pad hack in define_handler_struct
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sun, 23 Jun 2019 14:41:04 +0000 (16:41 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:44 +0000 (11:33 +0100)
src/comp.c

index aee7ca99463a3f775a024385c841f2616b5f33dc..fe3fac606d933f00d46a119a434ab7f5a7862a67 100644 (file)
@@ -818,56 +818,37 @@ define_handler_struct (void)
                                                       comp.handler_ptr_type,
                                                       "next");
   gcc_jit_field *fields[] =
-    { gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.int_type,
-                                "type"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.lisp_obj_type,
-                                "tag_or_ch"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.int_type,
-                                "nonlocal_exit"),
+    { gcc_jit_context_new_field (
+       comp.ctxt,
+       NULL,
+       gcc_jit_context_new_array_type (comp.ctxt,
+                                       NULL,
+                                       comp.char_type,
+                                       offsetof (struct handler, val)),
+       "pad0"),
       comp.handler_val_field,
       comp.handler_next_field,
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.handler_ptr_type,
-                                "nextfree"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.lisp_obj_ptr_type,
-                                "bytecode_top"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.int_type,
-                                "bytecode_dest"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                gcc_jit_context_new_array_type (comp.ctxt,
-                                                                NULL,
-                                                                comp.char_type,
-                                                                4),
-                                "pad"),
+      gcc_jit_context_new_field (
+       comp.ctxt,
+       NULL,
+       gcc_jit_context_new_array_type (comp.ctxt,
+                                       NULL,
+                                       comp.char_type,
+                                       offsetof (struct handler, jmp)
+                                       - offsetof (struct handler, next)
+                                       - sizeof (((struct handler *) 0)->next)),
+       "pad1"),
       comp.handler_jmp_field,
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.emacs_int_type,
-                                "f_lisp_eval_depth"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.ptrdiff_type,
-                                "pdlcount"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.int_type,
-                                "poll_suppress_count"),
-      gcc_jit_context_new_field (comp.ctxt,
-                                NULL,
-                                comp.int_type,
-                                "interrupt_input_blocked") };
+      gcc_jit_context_new_field (
+       comp.ctxt,
+       NULL,
+       gcc_jit_context_new_array_type (comp.ctxt,
+                                       NULL,
+                                       comp.char_type,
+                                       sizeof (struct handler)
+                                       - offsetof (struct handler, jmp)
+                                       - sizeof (((struct handler *) 0)->jmp)),
+       "pad2") };
   gcc_jit_struct_set_fields (comp.handler,
                             NULL,
                             sizeof (fields) / sizeof (*fields),