Sounds like a potential bug in the inliner. Would be good to get a reduced
test case.

On Fri, Aug 12, 2016 at 7:56 PM, Scott T <[email protected]> wrote:

> I get the same as you - I haven't been able to produce a concise example
> of this behaviour yet. The actual bug is nested deep within
> VoronoiDelaunay.jl and GeometricalPredicates.jl. However, as far as I can
> tell the basic structure of it is the same: a type's fields are changed by
> a function, and getters are used to get the type's fields and then pass
> them back into that function. Then it works fine on julia 0.4 and julia 0.5
> master running in Gallium, but behaves oddly otherwise on 0.5.
>
> Anyway, I am going to try to produce a minimum working example tomorrow so
> I'll get back to you with that (or to let you know that I'm stupid and
> missed something obvious).
>
> On Friday, 12 August 2016 23:52:32 UTC+1, Steven G. Johnson wrote:
>>
>>
>>
>> On Friday, August 12, 2016 at 3:59:20 PM UTC-4, Scott T wrote:
>>>
>>> The thing is that this line behaves differently in julia 0.4 and julia
>>> 0.5, and it also behaves differently in julia 0.5 and julia 0.5 stepped
>>> through with Gallium. Is this some kind of undefined behaviour? I would
>>> have expected geta, getb and getc to be evaluated first and for their
>>> values to be passed to the function, but the behaviour I'm seeing on julia
>>> 0.5 is like it's evaluating them lazily. Have I missed something?
>>>
>>
>> No, arguments are always evaluated before the function is called.   I
>> just tried it, and it works fine for me with Julia master:
>>
>> julia> type Foo; a; b; c; end; geta(A) = A.a; getb(A) = A.b; getc(A) =
>> A.c; shuffleFields!(A, a, b, c) = (A.a = b; A.b = c; A.c = a)
>>
>> shuffleFields! (generic function with 1 method)
>>
>>
>> julia> A = Foo(1,2,3)
>>
>> Foo(1,2,3)
>>
>>
>> julia> shuffleFields!(A, getb(A), getc(A), geta(A))
>>
>> 2
>>
>>
>> julia> A
>> Foo(3,1,2)
>>
>>
>> What do you get with the above code?
>>
>>

Reply via email to