[Issue 17092] New: [REG 2.069.0] cannot access frame pointer of MapResult!(__lambda1, Result).MapResult

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 15 09:43:04 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17092

          Issue ID: 17092
           Summary: [REG 2.069.0] cannot access frame pointer of
                    MapResult!(__lambda1, Result).MapResult
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

>From gdc's own testsuite, this stopped being compilable from 2.069 and onwards.
---
void main()
{
    import std.algorithm : map;
    import std.parallelism : taskPool;
    import std.range : iota;

    immutable n = 10000;
    immutable delta = 1.0 / n;
    immutable pi = 4.0 * delta * taskPool.reduce!"a + b"(
        map!((int i) { immutable x = (i - 0.5) * delta; return 1.0 / (1.0 + x *
x); })(iota(n)));
}
---

Introduced by: https://github.com/dlang/phobos/pull/3522

Emplacing `RTask.init` instead of `RTask()` fixes the compiler error, however,
as per comment in PR:

task[] = RTask.init; has two bugs:

1. RTask is a nested struct, so RTask.init contains null context pointer.
2. That is a block assignment, so there is a possibility to call RTask.~this()
on garbage objects (stack allocated buf is initialized by void).

I'm not totally convinced that (1) is a problem however.

--


More information about the Digitalmars-d-bugs mailing list