From fde7a3e7a1aed1048ebbdf3a0aa957b41fcf7c83 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Mon, 7 May 2012 15:02:16 -0600 Subject: [PATCH] give virtualThunks names based on index, to avoid conflicts --- src/compile.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compile.cpp b/src/compile.cpp index 1adce59df7..e5621cf5b6 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -10000,7 +10000,15 @@ compileVirtualThunk(MyThread* t, unsigned index, unsigned* size) a->setDestination(start); a->write(); - logCompile(t, start, *size, 0, "virtualThunk", 0); + const char* const virtualThunkBaseName = "virtualThunk"; + const size_t virtualThunkBaseNameLength = strlen(virtualThunkBaseName); + const size_t maxIntStringLength = 10; + + THREAD_RUNTIME_ARRAY(t, char, virtualThunkName, virtualThunkBaseNameLength + maxIntStringLength); + + sprintf(RUNTIME_ARRAY_BODY(virtualThunkName), "%s%d", virtualThunkBaseName, index); + + logCompile(t, start, *size, 0, virtualThunkName, 0); return reinterpret_cast(start); }