clover: Use conversion operator to initialize build log from compat::string.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 18 Aug 2014 06:05:25 +0000 (09:05 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 5 Sep 2014 06:27:20 +0000 (09:27 +0300)
Fixes binary garbage in the compilation logs caused by
compat::string::c_str() not being null-terminated (which is a bug on
its own that will be fixed in another commit).

Reported-by: EdB <edb+mesa@sigluy.net>
src/gallium/state_trackers/clover/core/program.cpp

index 30a1f0e0762cfc6bc6522ac386e8eb694f6d6232..6c224dbe083c677d990c5b94d7dec44f36ea25e9 100644 (file)
@@ -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, log });
          } catch (const build_error &) {
-            _logs.insert({ &dev, std::string(log.c_str()) });
+            _logs.insert({ &dev, log });
             throw;
          }
       }