[m-dev.] [Mercury-Language/mercury] Segfault in only Mercury after solutions in a particular code path (#72)
zoltan.somogyi at runbox.com
Tue Nov 17 12:08:26 AEDT 2020
2020-11-17 11:36 GMT+11:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:ature.
>> What about a term that contains a direct arg functor with a free
>> argument, e.g.
>> > R0 = unreviewed(_), % direct arg functor
>> Foo = foo(R0, 123),
>> fill(R0, R),
>> > Could it be possible to write something in the ... such that the
>> construction of Foo cannot be delayed after the call to fill,
>> so that the reference to R0 would be replaced by R?
>> I wasn't able to get the attached example to compile but
>> perhaps it is possible somehow.
> Sorry, but I don't understand what your point is.
Actually, now I do. You are saying that handling the calls
that fill in R0's argument is not enough, and the transformation
should also handle situations in which the partially instantiated term
is put into other, bigger terms.
At the moment, the lack of alias tracking in the mode checker
makes it impossible to fill in such holes, because the act
of binding a variable representing (in this case) the one
argument of unreviewed cannot update the inst of Foo.
Therefore code that has this problem wouldn't compile
with or without a solution to the direct_arg argument
passing problem. It probably wouldn't hurt to generate
a specific error message for such occurrences anyway.
More information about the developers