[Mesa-dev] [PATCH 1/3] clover: fix _logs string creation
Jan Vesely
jan.vesely at rutgers.edu
Fri Sep 5 07:16:05 PDT 2014
On Mon, 2014-08-18 at 09:20 +0300, Francisco Jerez wrote:
> EdB <edb+mesa at sigluy.net> writes:
>
> > compact::string is not \0 terminated.
> > size() need to be used for std::string creation
> > ---
> > src/gallium/state_trackers/clover/core/program.cpp | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
> > index e09c3aa..3f504d5 100644
> > --- a/src/gallium/state_trackers/clover/core/program.cpp
> > +++ b/src/gallium/state_trackers/clover/core/program.cpp
> > @@ -61,9 +61,9 @@ program::build(const ref_vector<device> &devs, const char *opts) {
> > dev.ir_target(), build_opts(dev),
> > log));
> > _binaries.insert({ &dev, module });
> > - _logs.insert({ &dev, std::string(log.c_str()) });
> > + _logs.insert({ &dev, std::string(log.c_str(), log.size()) });
> > } catch (const build_error &) {
> > - _logs.insert({ &dev, std::string(log.c_str()) });
> > + _logs.insert({ &dev, std::string(log.c_str(), log.size()) });
>
> Both of these should just be using the conversion operator. See
> attachment.
I came up with an almost identical patch to your attachment.
you can add my
Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>
>
> > throw;
> > }
> > }
> > --
> > 2.0.4
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
--
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140905/5439ca4b/attachment.sig>
More information about the mesa-dev
mailing list