2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00

Bugfix. When a generator had a same type amoung source and target types,

we hanged.

* build/generators.jam: (viable-source-types-real): Rewrite to
  avoid processing the same type twice. Use non-recursive implementation,
  too.


[SVN r26562]
This commit is contained in:
Vladimir Prus
2004-12-21 08:50:37 +00:00
parent 8cc138879c
commit 50195bc3df

View File

@@ -706,35 +706,42 @@ rule base-to-derived-type-conversion ( targets * : target-types +
# of calling itself recusrively on source types.
local rule viable-source-types-real ( target-type )
{
# Find all generators for 'target-type'. Unlike 'find-viable-generators'
# we don't care about property-set
local generators ;
local t = [ type.all-bases $(target-type) ] ;
while $(t[1])
{
generators += $(.generators.$(t[1])) ;
t = $(t[2-]) ;
}
# Find all source type for those generators
local source-types ;
for local g in $(generators)
{
source-types += [ $(g).source-types ] ;
}
local result = $(source-types) ;
for local s in $(source-types)
local result ;
# 't' is the list of types which are not yet processed
while $(t)
{
result += [ viable-source-types $(s) ] ;
}
local result2 ;
for local s in $(result)
{
result2 += [ type.all-derived $(s) ] ;
}
result = [ sequence.unique $(result2) ] ;
# Find all generators for current type.
# Unlike 'find-viable-generators' we don't care about property-set.
local generators = $(.generators.$(t[1])) ;
t = $(t[2-]) ;
for local g in $(generators)
{
for local source-type in [ $(g).source-types ]
{
if ! $(source-type) in $(result)
{
# If generator accepts 'source-type' it
# will happily accept any type derived from it
local all = [ type.all-derived $(source-type) ] ;
for local n in $(all)
{
if ! $(n) in $(result)
{
t += $(n) ;
result += $(n) ;
}
}
}
}
}
}
result = [ sequence.unique $(result) ] ;
return $(result) ;
}