https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90110

--- Comment #7 from Ian Lance Taylor <ian at airs dot com> ---
> What is the condition i > 0x7fffffff for?  Shouldn't that test val instead?

Yes, it certainly should.  Thanks.  It's not the problem here, but should be
fixed.

> Just a wild guess - does this->body_.substr(start, i - start).c_str() 
really live until after strtol has completed?

I *think* it should be OK.  The rule in C++ is that temporary objects are
destroyed after the full expression that lexically contains the point at which
they are created has been evaluated.  In this case the full expression is the
call to strtol, so the temporary object created by the call to substr should
live until the call to strtol is complete.

Reply via email to