https://issues.dlang.org/show_bug.cgi?id=3925
Nick Treleaven changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=3925
--- Comment #7 from bearophile_h...@eml.cc 2011-06-29 15:32:18 PDT ---
Two more cases of undetected escaping of reference:
int* ptr;
void foo1() {
int local;
ptr = &local;
}
void foo2(int** x) {
int i;
*x = &i;
}
void main() {}
http://d.puremagic.com/issues/show_bug.cgi?id=3925
--- Comment #6 from bearophile_h...@eml.cc 2010-10-25 15:40:48 PDT ---
(In reply to comment #5)
> ---
> class A{}
>
> A foo(A a)
> {
> return a;
> }
>
> A bar()
> {
> scope A a=new A();
> return foo(a);
> }
> ---
The "scope" is de
http://d.puremagic.com/issues/show_bug.cgi?id=3925
--- Comment #5 from Sobirari Muhomori 2010-10-25
13:59:45 PDT ---
---
class A{}
A foo(A a)
{
return a;
}
A bar()
{
scope A a=new A();
return foo(a);
}
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=
http://d.puremagic.com/issues/show_bug.cgi?id=3925
--- Comment #4 from bearophile_h...@eml.cc 2010-10-22 19:26:06 PDT ---
Here DMD 2.049 doesn't find the error, but it should:
int* foo() {
int x;
int* p = &x;
return p;
}
void main() {}
--
Configure issuemail: http://d.puremagic.c
http://d.puremagic.com/issues/show_bug.cgi?id=3925
Michel Fortin changed:
What|Removed |Added
CC||michel.for...@michelf.com
--- Comment
http://d.puremagic.com/issues/show_bug.cgi?id=3925
Don changed:
What|Removed |Added
CC||clugd...@yahoo.com.au
--- Comment #2 from Don 2
http://d.puremagic.com/issues/show_bug.cgi?id=3925
--- Comment #1 from bearophile_h...@eml.cc 2010-03-10 10:08:04 PST ---
This was the original code by Michel Fortin:
@safe ref int foo(ref int a) {
return a;
}
@safe ref int bar() {
int a;
return foo(a);
}
Norbert Nemec comments:
>