digitalmars.D.bugs - [Issue 11560] New: API returning immutable string on stack?
- d-bugmail puremagic.com (21/21) Nov 19 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11560
- d-bugmail puremagic.com (10/10) Nov 19 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11560
- d-bugmail puremagic.com (17/18) Nov 19 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11560
- d-bugmail puremagic.com (11/11) Nov 19 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11560
https://d.puremagic.com/issues/show_bug.cgi?id=11560 Summary: API returning immutable string on stack? Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: turkeyman gmail.com This code: string hash = std.digest.digest.toHexString(std.digest.sha.sha1Of("text")); Does it seem reasonable that users should expect that 'hash' is on the stack? As the program continues, 'hash' starts changing randomly. hash.idup, it persists as expected. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11560 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies gmail.com A compilable test case that shows the problem would be helpful. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11560A compilable test case that shows the problem would be helpful.string func() { string hash = std.digest.digest.toHexString(std.digest.sha.sha1Of("text")); return hash; } void main() { string s = func(); std.stdio.writeln("hello world"); // call a funtion std.stdio.writeln(s); // s is rubbish } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11560 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE *** This issue has been marked as a duplicate of issue 9279 *** -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2013