compiler.cfg.liveness: Break the infinite loop--add the base-pointer as f to start with, and replace it with the real one if there's not a circular chain. Fixes #22 again.

db4
Doug Coleman 2013-01-01 14:47:54 -08:00
parent 125e4befd3
commit 63e55ac813
1 changed files with 8 additions and 3 deletions

View File

@ -98,10 +98,15 @@ M: ##sub lookup-base-pointer*
M: vreg-insn lookup-base-pointer* 2drop f ;
! Can't use cache here because of infinite recursion inside
! the quotation passed to cache
: lookup-base-pointer ( vreg -- vregs/f )
base-pointers get [
dup ?leader insn-of lookup-base-pointer*
] cache ;
base-pointers get ?at [
f over base-pointers get set-at
[ dup ?leader insn-of lookup-base-pointer* ] keep
dupd base-pointers get set-at
] unless ;
:: visit-derived-root ( vreg derived-roots gc-roots -- )
vreg lookup-base-pointer :> base