Fix compiler breakage if a GENERIC# has an incorrect stack effect declaration
							parent
							
								
									fd3a568191
								
							
						
					
					
						commit
						b67b617746
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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 -- ? )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue