source: src/examples/gc_no_raii/bug-repro/malloc.c @ 863c413

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change on this file since 863c413 was 273080f, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

added a bunch of bug repros

  • Property mode set to 100644
File size: 448 bytes
Line 
1forall(otype T)
2struct wrapper
3{
4    T val;
5};
6
7forall(otype T)
8void ctor(wrapper(T)* this)
9{
10    this->val = 0;
11}
12
13forall(otype T)
14wrapper(T) gcmalloc()
15{
16    wrapper(T) w;
17    ctor(&w);
18    return w;
19}
20
21forall(otype T)
22wrapper(T)* ?=? (wrapper(T)* lhs, wrapper(T)* rhs)
23{
24    lhs->val = rhs->val;
25    return lhs;
26}
27
28int main(int argc, char *argv[])
29{
30    wrapper(int) test;
31    test = gcmalloc();
32    return 0;
33}
Note: See TracBrowser for help on using the repository browser.