History

Fix bounds checking struct return on arm/arm64

herman ten brugge committed 4 years ago

Commit 4a03f1f1 parent 02443202 files · +4 −4Browse files

Unified · Split

2 files
  1. arm-gen.c +2 −2
  2. arm64-gen.c +2 −2
arm-gen.c+2−2
@@ -883,14 +883,14 @@ static void gen_bounds_epilog(void) · 882 unmodified lines
883883
884884 /* generate bound check local freeing */
885885 o(0xe92d0003); /* push {r0,r1} */
886− o(0xed2d0b02); /* vpush {d0} */
886+ o(0xed2d0b04); /* vpush {d0,d1} */
887887 o(0xe59f0000); /* ldr r0, [pc] */
888888 o(0xea000000); /* b $+4 */
889889 greloc(cur_text_section, sym_data, ind, R_ARM_REL32);
890890 o(-12); /* lbounds_section->data_offset */
891891 o(0xe080000f); /* add r0,r0,pc */
892892 gen_bounds_call(TOK___bound_local_delete);
893− o(0xecbd0b02); /* vpop {d0} */
893+ o(0xecbd0b04); /* vpop {d0,d1} */
894894 o(0xe8bd0003); /* pop {r0,r1} */
895895 }
896896 #endif
arm64-gen.c+2−2
@@ -725,7 +725,7 @@ static void gen_bounds_epilog(void) · 724 unmodified lines
725725 }
726726
727727 /* generate bound check local freeing */
728− o(0xf81f0fe0); /* str x0, [sp, #-16]! */
728+ o(0xa9be07e0); /* stp x0, x1, [sp, #-32]! */
729729 o(0x3c9f0fe0); /* str q0, [sp, #-16]! */
730730 greloca(cur_text_section, sym_data, ind, R_AARCH64_ADR_GOT_PAGE, 0);
731731 o(0x90000000 | 0); // adrp x0, #sym_data
@@ -733,7 +733,7 @@ static void gen_bounds_epilog(void) · 1 unmodified line
733733 o(0xf9400000 | 0 | (0 << 5)); // ld x0,[x0, #sym_data]
734734 gen_bounds_call(TOK___bound_local_delete);
735735 o(0x3cc107e0); /* ldr q0, [sp], #16 */
736− o(0xf84107e0); /* ldr x0, [sp], #16 */
736+ o(0xa8c207e0); /* ldp x0, x1, [sp], #32 */
737737 }
738738 #endif
739739

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t