Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One unexpected bug #147

Open
gogo9th opened this issue Jun 23, 2018 · 0 comments
Open

One unexpected bug #147

gogo9th opened this issue Jun 23, 2018 · 0 comments

Comments

@gogo9th
Copy link

gogo9th commented Jun 23, 2018

I found one bug in Jalangi2. If I run my test JS file Google.ca.js with my analysis-statement.js with the following command:

$ node src/js/commands/jalangi.js --inlineIID --inlineSource --analysis analysis-statements.js node-ok/Google.ca.js

, the program crashes with "Maximum Call Stack Exceeded" error. This bug occurs if I call "iidToLocation()" function inside the analysis chain. I fixed the bug inside jalangi2-master/src/js/runtime/iidToLocation.js:

...
sandbox.iidToLocation = function (sid, iid) {
var ret, arr, gid=sid;
if (sandbox.smap) {
if (typeof sid === 'string' && sid.indexOf(':')>=0) {
sid = sid.split(':');
iid = Number/parseInt/(sid[1]);
sid = Number/parseInt/(sid[0]);
...

If you parse integegers with parseInt() function, after a certain point Jalangi2 recursively calls iidToLocation() instead of proceeding to the code following the parseInt() call. This problem goes away if I replace parseInt to Number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant