Permalink
Browse files

Fixed a bug in the allocation functions implemented in assembly that …

…caused them not to return their actual result.
  • Loading branch information...
1 parent a8eb8cd commit 77996ab9eac66974ed828c28a5ed0a04e7dd2ff4 @colinbenner committed Mar 9, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/asmrun/amd64.S
View
24 src/asmrun/amd64.S
@@ -202,44 +202,44 @@ FUNCTION(G(caml_call_gc))
FUNCTION(G(caml_alloc1))
.Lcaml_alloc1:
- LOAD_VAR(caml_young_ptr, %r11)
- subq $16, %r11
- CMP_VAR(caml_young_limit, %r11)
+ LOAD_VAR(caml_young_ptr, %rax)
+ subq $16, %rax
+ CMP_VAR(caml_young_limit, %rax)
jb .L100
ret
.L100:
RECORD_STACK_FRAME(0)
- STORE_VAR(%r11, caml_young_ptr)
+ STORE_VAR(%rax, caml_young_ptr)
subq $8, %rsp
call .Lcaml_call_gc
addq $8, %rsp
jmp .Lcaml_alloc1
FUNCTION(G(caml_alloc2))
.Lcaml_alloc2:
- LOAD_VAR(caml_young_ptr, %r11)
- subq $24, %r11
- CMP_VAR(caml_young_limit, %r11)
+ LOAD_VAR(caml_young_ptr, %rax)
+ subq $24, %rax
+ CMP_VAR(caml_young_limit, %rax)
jb .L101
ret
.L101:
RECORD_STACK_FRAME(0)
- STORE_VAR(%r11, caml_young_ptr)
+ STORE_VAR(%rax, caml_young_ptr)
subq $8, %rsp
call .Lcaml_call_gc
addq $8, %rsp
jmp .Lcaml_alloc2
FUNCTION(G(caml_alloc3))
.Lcaml_alloc3:
- LOAD_VAR(caml_young_ptr, %r11)
- subq $32, %r11
- CMP_VAR(caml_young_limit, %r11)
+ LOAD_VAR(caml_young_ptr, %rax)
+ subq $32, %rax
+ CMP_VAR(caml_young_limit, %rax)
jb .L102
ret
.L102:
RECORD_STACK_FRAME(0)
- STORE_VAR(%r11, caml_young_ptr)
+ STORE_VAR(%rax, caml_young_ptr)
subq $8, %rsp
call .Lcaml_call_gc
addq $8, %rsp

0 comments on commit 77996ab

Please sign in to comment.