Fix bounds checking struct return on arm/arm64

This commit is contained in:
herman ten brugge 2022-03-28 09:07:09 +02:00
parent 0244320b88
commit 4a03f1fb20
2 changed files with 4 additions and 4 deletions

View file

@ -883,14 +883,14 @@ static void gen_bounds_epilog(void)
/* generate bound check local freeing */ /* generate bound check local freeing */
o(0xe92d0003); /* push {r0,r1} */ o(0xe92d0003); /* push {r0,r1} */
o(0xed2d0b02); /* vpush {d0} */ o(0xed2d0b04); /* vpush {d0,d1} */
o(0xe59f0000); /* ldr r0, [pc] */ o(0xe59f0000); /* ldr r0, [pc] */
o(0xea000000); /* b $+4 */ o(0xea000000); /* b $+4 */
greloc(cur_text_section, sym_data, ind, R_ARM_REL32); greloc(cur_text_section, sym_data, ind, R_ARM_REL32);
o(-12); /* lbounds_section->data_offset */ o(-12); /* lbounds_section->data_offset */
o(0xe080000f); /* add r0,r0,pc */ o(0xe080000f); /* add r0,r0,pc */
gen_bounds_call(TOK___bound_local_delete); gen_bounds_call(TOK___bound_local_delete);
o(0xecbd0b02); /* vpop {d0} */ o(0xecbd0b04); /* vpop {d0,d1} */
o(0xe8bd0003); /* pop {r0,r1} */ o(0xe8bd0003); /* pop {r0,r1} */
} }
#endif #endif

View file

@ -725,7 +725,7 @@ static void gen_bounds_epilog(void)
} }
/* generate bound check local freeing */ /* generate bound check local freeing */
o(0xf81f0fe0); /* str x0, [sp, #-16]! */ o(0xa9be07e0); /* stp x0, x1, [sp, #-32]! */
o(0x3c9f0fe0); /* str q0, [sp, #-16]! */ o(0x3c9f0fe0); /* str q0, [sp, #-16]! */
greloca(cur_text_section, sym_data, ind, R_AARCH64_ADR_GOT_PAGE, 0); greloca(cur_text_section, sym_data, ind, R_AARCH64_ADR_GOT_PAGE, 0);
o(0x90000000 | 0); // adrp x0, #sym_data o(0x90000000 | 0); // adrp x0, #sym_data
@ -733,7 +733,7 @@ static void gen_bounds_epilog(void)
o(0xf9400000 | 0 | (0 << 5)); // ld x0,[x0, #sym_data] o(0xf9400000 | 0 | (0 << 5)); // ld x0,[x0, #sym_data]
gen_bounds_call(TOK___bound_local_delete); gen_bounds_call(TOK___bound_local_delete);
o(0x3cc107e0); /* ldr q0, [sp], #16 */ o(0x3cc107e0); /* ldr q0, [sp], #16 */
o(0xf84107e0); /* ldr x0, [sp], #16 */ o(0xa8c207e0); /* ldp x0, x1, [sp], #32 */
} }
#endif #endif