Skip navigation
Cod3 Monk3y, Inc.
Currently Being Moderated

BUG: std::string serious problems

Sep 4, 2009 11:29 AM

_divy discovered this bug which I described in:

http://forums.adobe.com/message/2227018#2227018

 

Basically, std::string appears to be mismanaging the underlying character buffers.

 

Compile this code with standard g++ and you'll get "b,a", but with Alchemy you'll get "b,b". This leads to serious errors in any STL container class that uses std::string, which you can see in _divy's earlier post.

 

string s1;

string s2;


s1 = "a";

s2 = s1; // copy constructor

s1 = "b";


// use your favorite TRACE function here

TRACE(s1); // expected: "b", actual: "b"

TRACE(s2); // expected: "a", actual: "b", ERROR

 

I know Alchemy is an experimental product but I find it very useful. I'm very lucky that the code I'm porting doesn't use std::string. However std::string is a very useful utility class and it is absolutely CRITICAL for this to function correctly for the majority of STL code to work.

 

Is there a formal bug submission process for Alchemy?

 

/cm

 
Replies
  • Currently Being Moderated
    Sep 20, 2011 11:15 AM   in reply to Cod3 Monk3y, Inc.

    fyi, I've figured out a fix to this problem.  See here or here.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points