compiler.tree.propagation: ensure that we don't call 'equal?' or 'hashcode' on literals in words being compiled
parent
d0dc6ba8af
commit
3b5f7a9ecf
|
@ -312,16 +312,12 @@ SYMBOL: value-infos
|
|||
value-info >literal< ;
|
||||
|
||||
: possible-boolean-values ( info -- values )
|
||||
dup literal?>> [
|
||||
literal>> 1array
|
||||
] [
|
||||
class>> {
|
||||
{ [ dup null-class? ] [ { } ] }
|
||||
{ [ dup true-class? ] [ { t } ] }
|
||||
{ [ dup false-class? ] [ { f } ] }
|
||||
[ { t f } ]
|
||||
} cond nip
|
||||
] if ;
|
||||
class>> {
|
||||
{ [ dup null-class? ] [ { } ] }
|
||||
{ [ dup true-class? ] [ { t } ] }
|
||||
{ [ dup false-class? ] [ { f } ] }
|
||||
[ { t f } ]
|
||||
} cond nip ;
|
||||
|
||||
: node-value-info ( node value -- info )
|
||||
swap info>> at* [ drop null-info ] unless ;
|
||||
|
|
|
@ -946,3 +946,9 @@ M: tuple-with-read-only-slot clone
|
|||
|
||||
[ t ] [ [ { float float } declare max ] { max } inlined? ] unit-test
|
||||
[ f ] [ [ { float float } declare max ] { float-max } inlined? ] unit-test
|
||||
|
||||
! Propagation should not call equal?, hashcode, etc on literals in user code
|
||||
[ V{ } ] [ [ 4 <reversed> [ 2drop ] with each ] final-info ] unit-test
|
||||
|
||||
! Reduction
|
||||
[ 1 ] [ [ 4 <reversed> [ nth-unsafe ] [ ] unless ] final-info length ] unit-test
|
||||
|
|
Loading…
Reference in New Issue