fix of function filter

This commit is contained in:
cppchedy
2017-10-13 22:55:18 +01:00
parent 9a848af892
commit 7cf0eaf2f1
+7 -11
View File
@@ -33,17 +33,17 @@ var InstructionType_conditionalJmpInst = 1;
var InstructionType_notRetInst = 2;
var InstructionType_retInst = 3;
var isFunctionName = function (x) {
return x.text.trim().indexOf('.') !== 0 &&
!x.text.includes(' for ');// deal with typeinfo name for, typeinfo for, vtable for
};
// this mess is intended to be ported to another file.
function separateCodeFromData(asmArr) {
var jmpLabelRegex = /\.L{1}\d+:/;
var isFunctionName = function (x) {
return !x.text.includes('.') &&
!x.text.includes(' for ');// deal with typeinfo name for, typeinfo for, vtable for
};
var isCode = function (x) {
return x && x.text && (x.source !== null || jmpLabelRegex.test(x.text) ||
isFunctionName(x));
@@ -87,14 +87,10 @@ var gccX86 = {
function separateCodeFromData_(asmArr) {
var jmpLabelRegex = /\.LBB\d+_\d+:/;
var isFunctionName = function (x) {
var functionNameRegex = /((\w|\(|\))*): # @\1/;
return functionNameRegex.test(x);
};
var isCode = function (x) {
return x && x.text && (x.source !== null || jmpLabelRegex.test(x.text) ||
isFunctionName(x.text));
isFunctionName(x));
};
var removeComments = function (x) {