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 30a1f0e..6c224db 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;
          }
       }