Fix compiler breakage if a GENERIC# has an incorrect stack effect declaration

db4
Slava Pestov 2009-05-12 21:23:52 -05:00
parent fd3a568191
commit b67b617746
2 changed files with 22 additions and 4 deletions

View File

@ -395,4 +395,20 @@ DEFER: loop-bbb
: modular-arithmetic-bug ( a -- b ) >integer 256 mod ;
[ 1 ] [ 257 modular-arithmetic-bug ] unit-test
[ -10 ] [ -10 modular-arithmetic-bug ] unit-test
[ -10 ] [ -10 modular-arithmetic-bug ] unit-test
! Optimizer needs to ignore invalid generics
GENERIC# bad-dispatch-position-test* 3 ( -- )
M: object bad-dispatch-position-test* ;
: bad-dispatch-position-test ( -- ) bad-dispatch-position-test* ;
[ 1 2 3 4 bad-dispatch-position-test ] must-fail
[ ] [
[
\ bad-dispatch-position-test forget
\ bad-dispatch-position-test* forget
] with-compilation-unit
] unit-test

View File

@ -59,9 +59,11 @@ M: callable splicing-nodes splicing-body ;
: inlining-standard-method ( #call word -- class/f method/f )
dup "methods" word-prop assoc-empty? [ 2drop f f ] [
[ in-d>> <reversed> ] [ [ dispatch# ] keep ] bi*
[ swap nth value-info class>> dup ] dip
specific-method
2dup [ in-d>> length ] [ dispatch# ] bi* <= [ 2drop f f ] [
[ in-d>> <reversed> ] [ [ dispatch# ] keep ] bi*
[ swap nth value-info class>> dup ] dip
specific-method
] if
] if ;
: inline-standard-method ( #call word -- ? )