Unified · Split
| @@ -5,7 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | __bound_alloca: |
| 6 | 6 | |
| 7 | 7 | #ifdef _WIN32 |
| 8 | − # bound checking is not implemented | |
| 9 | 8 | pop %rdx |
| 10 | 9 | mov %rcx,%rax |
| 11 | 10 | add $15,%rax |
| @@ -23,8 +22,18 @@ p2: · 11 unmodified lines | ||
| 23 | 22 | |
| 24 | 23 | sub %rax,%rsp |
| 25 | 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 | 37 | p3: |
| 29 | 38 | push %rdx |
| 30 | 39 | ret |
| @@ -1025,7 +1025,7 @@ void gfunc_call(int nb_args) · 1024 unmodified lines | ||
| 1025 | 1025 | |
| 1026 | 1026 | if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) { |
| 1027 | 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 | 1031 | /* other compilers don't clear the upper bits when returning char/short */ |