cpu.x86: GC root offsets were computed wrong in words containing alien calls
parent
8ccb56c924
commit
dd2a4c2c77
|
@ -462,3 +462,13 @@ TUPLE: myseq { underlying1 byte-array read-only } { underlying2 byte-array read-
|
|||
1 1
|
||||
[ [ HEX: f bitand ] bi@ [ shift ] [ drop -3 shift ] 2bi ] compile-call
|
||||
] unit-test
|
||||
|
||||
! GC root offsets were computed wrong on x86
|
||||
: gc-root-messup ( a -- b )
|
||||
dup [
|
||||
1024 (byte-array) 2array
|
||||
10 void* "libc" "malloc" { ulong } alien-invoke
|
||||
void "libc" "free" { void* } alien-invoke
|
||||
] when ;
|
||||
|
||||
[ ] [ 2000 [ "hello" clone dup gc-root-messup first eq? t assert= ] times ] unit-test
|
||||
|
|
|
@ -45,7 +45,7 @@ HOOK: extra-stack-space cpu ( stack-frame -- n )
|
|||
: param@ ( n -- op ) reserved-stack-space + stack@ ;
|
||||
|
||||
: gc-root-offsets ( seq -- seq' )
|
||||
[ n>> special-offset ] map f like ;
|
||||
[ n>> spill-offset special-offset ] map f like ;
|
||||
|
||||
: decr-stack-reg ( n -- )
|
||||
dup 0 = [ drop ] [ stack-reg swap SUB ] if ;
|
||||
|
|
Loading…
Reference in New Issue