dpnishant / jsprime

a javascript static security analysis tool
http://dpnishant.github.io/jsprime
Other
585 stars 103 forks source link

Maximum Call Stack exceeded error on the Chrome browser #21

Open neweffort opened 7 years ago

neweffort commented 7 years ago

Hi I tried to run JSPrime on my javascript code, I am facing an Maximum Call Stack exceeded error on the Chrome browser in the function checkFunctionAsReturns in engine.js. It is 1000 line long, sometimes the browser is crashing, is there any workaround for this ?Is there any upperbound on the file size ? is JSPrime not scalable ?

TejaswiniU commented 5 years ago

In engine.js at asignFunctionReturnValue() repetitive variable declaration made the loop run infinite times and caused heap out of memory . To overcome this loop optimisation is done by for (var j = 0; j < real_func_names.length ; j++)
to
var real_fun_name_length = real_func_names.length;
for (var j = 0; j < real_fun_name_length ; j++) Hope this can help you