Thread overview
[Issue 14783] Overlapping Arrays with Binary Operations on Itself
Aug 31, 2015
Vladimir Panteleev
Aug 31, 2015
Denis Shelomovskij
Aug 31, 2015
Vladimir Panteleev
Aug 31, 2015
Denis Shelomovskij
Aug 31, 2015
John Hall
Oct 06, 2022
RazvanN
Oct 06, 2022
John Hall
August 31, 2015
https://issues.dlang.org/show_bug.cgi?id=14783

Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com

--- Comment #1 from Vladimir Panteleev <thecybershadow@gmail.com> ---
I'm not sure if this is a regression or not, but the test case runs fine before this PR:

https://github.com/D-Programming-Language/druntime/pull/661

> The code below will not compile
Will not run

--
August 31, 2015
https://issues.dlang.org/show_bug.cgi?id=14783

Denis Shelomovskij <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg@gmail.com

--- Comment #2 from Denis Shelomovskij <verylonglogin.reg@gmail.com> ---
(In reply to Vladimir Panteleev from comment #1)
> I'm not sure if this is a regression or not, but the test case runs fine before this PR:
> 
> https://github.com/D-Programming-Language/druntime/pull/661
> 
> > The code below will not compile
> Will not run

"runs fine"? No, it didn't. It produced an undefined result as there was no support for such case, just lack of a check.

--
August 31, 2015
https://issues.dlang.org/show_bug.cgi?id=14783

--- Comment #3 from Vladimir Panteleev <thecybershadow@gmail.com> ---
> It produced an undefined result

In what situation would the result be not what the user expected? The test given here works as expected (produces 0,1,4).

--
August 31, 2015
https://issues.dlang.org/show_bug.cgi?id=14783

--- Comment #4 from Denis Shelomovskij <verylonglogin.reg@gmail.com> ---
(In reply to Vladimir Panteleev from comment #3)
> > It produced an undefined result
> 
> In what situation would the result be not what the user expected? The test given here works as expected (produces 0,1,4).

I don't now, I can't even guarantee this case exists now because it will require reading all the implementations in different assembly languages. The fact an "undefined behaviour" situation produces an expected result for now doesn't change anything. This functionality is (and was) not officially supported by array functions implementation. Period.

--
August 31, 2015
https://issues.dlang.org/show_bug.cgi?id=14783

--- Comment #5 from John Hall <john.michael.hall@gmail.com> ---
(In reply to Vladimir Panteleev from comment #3)
> > It produced an undefined result
> 
> In what situation would the result be not what the user expected? The test given here works as expected (produces 0,1,4).

I've only checked it on the latest versions of DMD (2.067 and 2.068), not before the earlier PR. You're right that it compiles in that I can get an exe. It's just that I can't run the exe.

--
October 06, 2022
https://issues.dlang.org/show_bug.cgi?id=14783

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |FIXED

--- Comment #6 from RazvanN <razvan.nitu1305@gmail.com> ---
The original test case compiles fine now.

--
October 06, 2022
https://issues.dlang.org/show_bug.cgi?id=14783

--- Comment #7 from John Hall <john.michael.hall@gmail.com> ---
Compiles and runs too (at least with run.dlang.org), which had been part of the
problem.

--