[m-rev.] for post-commit review: fix Mantis bug 529
Peter Wang
novalazy at gmail.com
Thu Feb 25 11:17:14 AEDT 2021
On Thu, 25 Feb 2021 03:44:32 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>
> 2021-02-24 19:56 GMT+11:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:
> > For review by Peter.
>
> Actually, I found a bug in that diff myself. The attached diff fixes it.
>
> Zoltan.
>
> Apply default func mode only to functions.
>
> compiler/modecheck_call.m:
> This fixes a bug in my fix for Mantis bug #529.
>
That looks fine, thanks for looking at it. I've updated the comment
for that bit of code.
Are you planning to do more work on the mode checker? I'm implementing
my subtypes proposal and will be touching the type checker and mode
checker this week and next week or so.
Peter
diff --git a/compiler/modecheck_call.m b/compiler/modecheck_call.m
index f4678d884..628f1cf53 100644
--- a/compiler/modecheck_call.m
+++ b/compiler/modecheck_call.m
@@ -412,8 +412,10 @@ modecheck_higher_order_call(PredOrFunc, PredVar, Args0, Args, Modes, Det,
(
HOInstInfo = higher_order(PredInstInfo)
;
- % If PredVar has no higher-order inst information, but is
- % a function type, then assume the default function mode.
+ % If PredVarInst has no higher-order inst information,
+ % then look for higher-order inst information in the type.
+ % Otherwise, if PredVar has a function type, assume the default
+ % function mode.
HOInstInfo = none_or_default_func,
mode_info_get_var_types(!.ModeInfo, VarTypes),
lookup_var_type(VarTypes, PredVar, Type),
More information about the reviews
mailing list