D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20799 - schwartzSort does not pin transformation results with indirections, leading to memory corruption
Summary: schwartzSort does not pin transformation results with indirections, leading t...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: Vladimir Panteleev
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-05-06 09:47 UTC by Vladimir Panteleev
Modified: 2020-05-09 01:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2020-05-06 09:47:07 UTC
import std.algorithm.sorting;
import std.range;

void main()
{
	auto arr = 1_000_000.iota.retro.array;
	arr.schwartzSort!(
		n => new int(n),
		(a, b) => *a < *b
	);
	assert(arr.isSorted());
}
Comment 1 Dlang Bot 2020-05-06 09:51:28 UTC
@CyberShadow created dlang/phobos pull request #7470 "Fix Issue 20799 - schwartzSort does not pin transformation results wi…" fixing this issue:

- Fix Issue 20799 - schwartzSort does not pin transformation results with indirections, leading to memory corruption

https://github.com/dlang/phobos/pull/7470
Comment 2 Dlang Bot 2020-05-06 09:58:01 UTC
@CyberShadow created dlang/phobos pull request #7471 "Fix Issue 20799 - schwartzSort does not pin transformation results wi…" fixing this issue:

- Fix Issue 20799 - schwartzSort does not pin transformation results with indirections, leading to memory corruption

https://github.com/dlang/phobos/pull/7471
Comment 3 Dlang Bot 2020-05-09 01:08:43 UTC
dlang/phobos pull request #7471 "Fix Issue 20799 - schwartzSort does not pin transformation results wi…" was merged into stable:

- 793a78c588647a3e987d8585470519d0f63983dc by Vladimir Panteleev:
  Fix Issue 20799 - schwartzSort does not pin transformation results with indirections, leading to memory corruption

https://github.com/dlang/phobos/pull/7471