[Issue 10086] strange segmentation fault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 15 11:14:40 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10086


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru


--- Comment #4 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-05-15 11:14:38 PDT ---
Reduced 

------ m1.d -----
module m1;

import std.stdio;
import callback;

struct S1 {
  int[][] a1 = [[1]];
}

@safe auto f1 (S1 r, bool o, dchar a, dchar b) {
  return r;
}

@safe auto f2 (T1, T2) (S1 r, T1 g, T2 h) {
  alias cpt = bind!(f1, r);
  return f3!(cpt!(bool, dchar, dchar))(g, h);
}

@safe auto f3 (alias l = (a, b, c) => 0, T1, T2) (T1 d, T2 e) {
  return l(true, 'a', 'b');
}

void main() {
  S1 s1;
  auto z = bind!(f2, s1)("", "");
  writeln(z);
}
----callback.d ----

module callback;

template bind (alias f, bindValues...) {
  auto bind (types...) (types values) {
    return f(bindValues, values);
  }
}
------------------

If compilation starts with 'callback' the program crashes, can confirm in 2.063
git head.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list