unify inner-d-index when unifying branches; close a few other leaks where meta-d could have been popped without updating inner-d-index
parent
66687d6b21
commit
6689113519
|
@ -42,8 +42,11 @@ IN: stack-checker.backend
|
|||
: shorten-by ( n seq -- )
|
||||
[ length swap - ] keep shorten ; inline
|
||||
|
||||
: shorten-d ( n -- )
|
||||
meta-d shorten-by meta-d length update-inner-d ;
|
||||
|
||||
: consume-d ( n -- seq )
|
||||
[ ensure-d ] [ meta-d shorten-by ] bi ;
|
||||
[ ensure-d ] [ shorten-d ] bi ;
|
||||
|
||||
: output-d ( values -- ) meta-d push-all ;
|
||||
|
||||
|
|
|
@ -61,7 +61,9 @@ SYMBOL: quotations
|
|||
branch-variable ;
|
||||
|
||||
: datastack-phi ( seq -- phi-in phi-out )
|
||||
[ input-count branch-variable ] [ \ meta-d active-variable ] bi
|
||||
[ input-count branch-variable ]
|
||||
[ inner-d-index branch-variable infimum inner-d-index set ]
|
||||
[ \ meta-d active-variable ] tri
|
||||
unify-branches
|
||||
[ input-count set ] [ ] [ dup >vector \ meta-d set ] tri* ;
|
||||
|
||||
|
@ -80,7 +82,8 @@ SYMBOL: quotations
|
|||
: copy-inference ( -- )
|
||||
\ meta-d [ clone ] change
|
||||
literals [ clone ] change
|
||||
input-count [ ] change ;
|
||||
input-count [ ] change
|
||||
inner-d-index [ ] change ;
|
||||
|
||||
GENERIC: infer-branch ( literal -- namespace )
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ IN: stack-checker.transforms
|
|||
|
||||
:: ((apply-transform)) ( quot values stack rstate -- )
|
||||
rstate recursive-state [ stack quot call-transformer ] with-variable
|
||||
values [ length meta-d shorten-by ] [ #drop, ] bi
|
||||
values [ length shorten-d ] [ #drop, ] bi
|
||||
rstate infer-quot ;
|
||||
|
||||
: literal-values? ( values -- ? ) [ literal-value? ] all? ;
|
||||
|
|
Loading…
Reference in New Issue