summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2016-06-14 16:19:40 -0700
committerStephen Hines <srhines@google.com>2016-06-14 19:21:17 -0700
commit68e30e410ce027099d0d85303aefa4134a461227 (patch)
tree7aa15774db3ca8e4009fa442b2161fead4771928
parent76c8c5bc4ad1e83cda7ff0669521869c5a266d5a (diff)
Fix crash in tracing code.
Bug: http://b/29358536 When we switched to standalone bcc, we accidentally removed the setters for this name field. It is simplest to just use the slot number for fixing this today, and revisit how to populate a proper name later on, since it would technically require vendor driver updates. (cherry picked from commit d969fdc55bc82d48242be3c6193a6548137e9579) Change-Id: I38a67a10d960d8fd2dddd03dc5155e3781f390d8
-rw-r--r--rsScriptC.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index c0f858a2..45c01b2e 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -29,6 +29,7 @@
#include <sys/stat.h>
+#include <sstream>
#include <string>
#ifdef USE_MINGW
@@ -201,15 +202,12 @@ void ScriptC::runForEach(Context *rsc,
// Trace this function call.
// To avoid overhead we only build the string if tracing is actually
// enabled.
- String8 *AString = NULL;
- const char *String = "";
+ std::stringstream ss;
if (ATRACE_ENABLED()) {
- AString = new String8("runForEach_");
- AString->append(mHal.info.exportedForeachFuncList[slot].first);
- String = AString->string();
+ ss << "runForEach slot[" << slot << "]";
}
- ATRACE_NAME(String);
- (void)String;
+ ATRACE_NAME(ss.str().c_str());
+
if (mRSC->hadFatalError()) return;
Context::PushState ps(rsc);
@@ -233,10 +231,6 @@ void ScriptC::runForEach(Context *rsc,
rsc->setError(RS_ERROR_FATAL_DRIVER,
"Driver support for multi-input not present");
}
-
- if (AString) {
- delete AString;
- }
}
void ScriptC::runReduce(Context *rsc, uint32_t slot,