We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 354d47a commit 50393d1Copy full SHA for 50393d1
compile.c
@@ -14002,7 +14002,11 @@ struct ibf_object_symbol {
14002
14003
#define IBF_ALIGNED_OFFSET(align, offset) /* offset > 0 */ \
14004
((((offset) - 1) / (align) + 1) * (align))
14005
-#define IBF_OBJBODY(type, offset) (const type *)\
+/* No cast, since it's UB to create an unaligned pointer.
14006
+ * Leave as void* for use with memcpy in those cases.
14007
+ * We align the offset, but the buffer pointer is only VALUE aligned,
14008
+ * so the returned pointer may be unaligned for `type` .*/
14009
+#define IBF_OBJBODY(type, offset) \
14010
ibf_load_check_offset(load, IBF_ALIGNED_OFFSET(RUBY_ALIGNOF(type), offset))
14011
14012
static const void *
0 commit comments