[Mesa-dev] [PATCH 1/3] clover: fix _logs string creation

Francisco Jerez currojerez at riseup.net
Sun Aug 17 23:20:03 PDT 2014


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.

>              throw;
>           }
>        }
> -- 
> 2.0.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-clover-Use-conversion-operator-to-initialize-build-l.patch
Type: text/x-diff
Size: 1415 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140818/46d84a70/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140818/46d84a70/attachment.sig>


More information about the mesa-dev mailing list