Unified · Split
| @@ -5,7 +5,6 @@ · 4 unmodified lines | |||
| 5 | __bound_alloca: | 5 | __bound_alloca: |
| 6 | 6 | ||
| 7 | #ifdef _WIN32 | 7 | #ifdef _WIN32 |
| 8 | # bound checking is not implemented | ||
| 9 | pop %rdx | 8 | pop %rdx |
| 10 | mov %rcx,%rax | 9 | mov %rcx,%rax |
| 11 | add $15,%rax | 10 | add $15,%rax |
| @@ -23,8 +22,18 @@ p2: · 11 unmodified lines | |||
| 23 | 22 | ||
| 24 | sub %rax,%rsp | 23 | sub %rax,%rsp |
| 25 | mov %rsp,%rax | 24 | mov %rsp,%rax |
| 26 | add $32,%rax | ||
| 27 | 25 | ||
| 26 | push %rdx | ||
| 27 | push %rax | ||
| 28 | mov %rcx,%rdx | ||
| 29 | mov %rax,%rcx | ||
| 30 | sub $20,%rsp | ||
| 31 | call __bound_new_region | ||
| 32 | add $20,%rsp | ||
| 33 | pop %rax | ||
| 34 | pop %rdx | ||
| 35 | |||
| 36 | add $32,%rax | ||
| 28 | p3: | 37 | p3: |
| 29 | push %rdx | 38 | push %rdx |
| 30 | ret | 39 | ret |
| @@ -1025,7 +1025,7 @@ void gfunc_call(int nb_args) · 1024 unmodified lines | |||
| 1025 | 1025 | ||
| 1026 | if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) { | 1026 | if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) { |
| 1027 | /* need to add the "func_scratch" area after alloca */ | 1027 | /* need to add the "func_scratch" area after alloca */ |
| 1028 | o(0x48); func_alloca = oad(0x05, func_alloca); /* sub $NN, %rax */ | 1028 | o(0x48); func_alloca = oad(0x2d, func_alloca); /* sub $NN, %rax */ |
| 1029 | } | 1029 | } |
| 1030 | 1030 | ||
| 1031 | /* other compilers don't clear the upper bits when returning char/short */ | 1031 | /* other compilers don't clear the upper bits when returning char/short */ |