File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -435,11 +435,11 @@ void* yr_arena_ref_to_ptr(
435
435
if (YR_ARENA_IS_NULL_REF (* ref ))
436
436
return NULL ;
437
437
438
- #if defined(__arm__ )
438
+ #if defined(__arm__ )
439
439
YR_ARENA_REF tmp_ref ;
440
440
memcpy (& tmp_ref , ref , sizeof (YR_ARENA_REF ));
441
441
ref = & tmp_ref ;
442
- #endif
442
+ #endif
443
443
444
444
return yr_arena_get_ptr (arena , ref -> buffer_id , ref -> offset );
445
445
}
Original file line number Diff line number Diff line change @@ -146,16 +146,18 @@ void* yr_notebook_alloc(
146
146
147
147
void * ptr = notebook -> page_list_head -> data + notebook -> page_list_head -> used ;
148
148
149
- #if defined(__arm__ )
150
- uintptr_t misalignment = (uintptr_t )ptr & 3 ;
149
+ // In ARM make sure the alignment of the returned buffer is 4 bytes.
150
+ #if defined(__arm__ )
151
+ uintptr_t misalignment = (uintptr_t ) ptr & 3 ;
152
+
151
153
if (misalignment )
152
154
{
153
- size += 4 - misalignment ;
154
- ptr += 4 - misalignment ;
155
+ size += 4 - misalignment ;
156
+ ptr += 4 - misalignment ;
155
157
}
156
- #endif
158
+ #endif
157
159
158
160
notebook -> page_list_head -> used += size ;
159
161
160
162
return ptr ;
161
- }
163
+ }
You can’t perform that action at this time.
0 commit comments