Bug 1294915 - Handle templatized C1/C4 constructors, r=bhackett

MozReview-Commit-ID: 2qvI8AHCtHN

--HG--
extra : rebase_source : 997d0777206527f9de0b243553035526de58d720
This commit is contained in:
Steve Fink 2017-04-13 16:41:02 -07:00
Родитель a09bebbd2d
Коммит 3eab9fd2e5
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -901,10 +901,15 @@ function maybeProcessMissingFunction(entry, addCallee)
return true;
}
// Similarly, a call to a C1 constructor might invoke the C4 constructor.
if (name.includes("C1E")) {
var callee = name.replace("C1E", "C4E");
addCallee(new CallSite(name, entry.safeArguments, entry.stack[0].location));
// Similarly, a call to a C1 constructor might invoke the C4 constructor. A
// mangled constructor will be something like _ZN<length><name>C1E... or in
// the case of a templatized constructor, _ZN<length><name>C1I...EE... so
// we hack it and look for "C1E" or "C1I" and replace them with their C4
// variants. This will have rare false matches, but so far we haven't hit
// any external function calls of that sort.
if (entry.mangledName().includes("C1E") || entry.mangledName().includes("C1I")) {
var callee = name.replace("C1E", "C4E").replace("C1I", "C4I");
addCallee(new CallSite(name, entry.safeArguments, entry.stack[0].location, entry.parameterNames));
return true;
}