From cb1b4b8db212dc0d8feb0784fe78a23d8371bf1e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 28 Sep 2016 13:24:01 -0400 Subject: [PATCH] add missed region to jl_set_lambda_inferred --- src/gf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gf.c b/src/gf.c index a0ccf69ad0ec9..fd5cf38f68a04 100644 --- a/src/gf.c +++ b/src/gf.c @@ -342,20 +342,25 @@ JL_DLLEXPORT jl_method_instance_t* jl_set_lambda_inferred( // there are 6(!) regions here to consider + boundary conditions for each if (li->max_world >= min_world && li->min_world <= max_world) { // there is a non-zero overlap between [li->min, li->max] and [min, max] - // there are now 3 regions left to consider + // there are now 4 regions left to consider // TODO: also take into account li->def->world range when computing preferred division - if (li->min_world <= max_world && li->max_world > max_world) { + if (li->max_world > max_world) { // prefer making it applicable to future ages, // as those are more likely to be useful - // this covers 2 of the remaining regions li->min_world = max_world + 1; truncate_world_range(li, set_min_world); } - else if (li->max_world >= min_world && li->min_world < min_world) { + else if (li->min_world < min_world) { assert(min_world > 1 && "logic violation: min(li->min_world) == 1 (by construction), so min(min_world) == 2"); li->max_world = min_world - 1; truncate_world_range(li, set_max_world); } + else { + // old inferred li is fully covered by new inference result, so just delete it + assert(!uninferred); + li->max_world = li->min_world - 1; + truncate_world_range(li, set_max_world); + } } // build a new entry to describe the new (inferred) applicability